Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
7d327095
Commit
7d327095
authored
5 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Automate registration of conda build artifacts to GitLab
parent
b24dc03f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
conda-recipe/publish.py
+39
-0
39 additions, 0 deletions
conda-recipe/publish.py
with
40 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
7d327095
...
...
@@ -5,5 +5,6 @@
# build and conda-build artifacts
build/*
conda-bld/*
dist/*
*.egg-info/*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
conda-recipe/publish.py
0 → 100644
+
39
−
0
View file @
7d327095
"""
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment