Skip to content
Snippets Groups Projects

Build 2024.10.01

Merged Christopher Randolph Rhodes requested to merge build-2024.10.01 into staging
2 files
+ 40
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 39
0
"""
Automate registration of conda build artifacts to EMBL GitLab;
assumes API access token is recorded in ~/.pypirc shell configuration file
"""
from configparser import ConfigParser
import json
from pathlib import Path
import requests
id = '5668'
proj = 'model_server'
root = Path('../conda-bld/')
# get authentication info from local config file
cfg = ConfigParser()
cfg.read(Path.home() / '.pypirc')
user = cfg['gitlab-model-server']['username']
pwd = cfg['gitlab-model-server']['password']
with open(root / 'channeldata.json', 'r') as fh:
chdata = json.load(fh)
# upload to GitLab API
res = []
for sd in ['noarch', 'win-64']:
with open(root / sd / 'repodata.json', 'r') as fh:
dd = json.load(fh)
for fn in dd['packages'].keys():
ver = dd['packages'][fn]['version']
stem = fn.split('.tar.bz2')[0]
pkgname = f'conda_{sd}_{stem}'
res.append(
requests.put(
f'https://git.embl.de/api/v4/projects/{id}/packages/generic/{pkgname}/{ver}/{fn}?status=default',
headers={'PRIVATE-TOKEN': pwd},
)
)
print('Finished')
print(res)
\ No newline at end of file
Loading