Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymagglobal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sec23
korte
pymagglobal
Commits
a93c6db2
Commit
a93c6db2
authored
4 years ago
by
Maximilian Schanner
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
1b52e112
No related branches found
No related tags found
No related merge requests found
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+3
-2
3 additions, 2 deletions
.gitlab-ci.yml
with
3 additions
and
2 deletions
.gitlab-ci.yml
+
3
−
2
View file @
a93c6db2
...
@@ -50,10 +50,11 @@ upload-job:
...
@@ -50,10 +50,11 @@ upload-job:
script
:
script
:
-
apt-get install -y -qq curl jq --fix-missing
-
apt-get install -y -qq curl jq --fix-missing
# get the version that is being installed
# get the version that is being installed
-
'
export
version=$(grep
-oP
"(?<=__version__
=
').*" ./pymagglobal/__init__.py | head -c -2)'
-
'
export
version=$(grep
-oP
"(?<=__version__
=
).*"
./pymagglobal/__init__.py)'
-
'
export
version=${version:1:-1}'
-
'
echo
$version'
-
'
echo
$version'
# get the corresponding package id
# get the corresponding package id
-
'
export
ID=$(curl
-s
--request
GET
--header
"PRIVATE-TOKEN:
${API_ACCES_TOKEN}"
"https://git.gfz-potsdam.de/api/v4/projects/${CI_PROJECT_ID}/packages"
|
jq
--arg
VERSION
"$version"
--raw-output
'
.[] | if .version==$VERSION then .id else
null
end
'
| grep -v
null
)'
-
'
export
ID=$(curl
-s
--request
GET
--header
"PRIVATE-TOKEN:
${API_ACCES_TOKEN}"
"https://git.gfz-potsdam.de/api/v4/projects/${CI_PROJECT_ID}/packages"
|
jq
--arg
VERSION
"$version"
--raw-output
"
.[]
|
if
.version==$VERSION
then
.id
else
null
end
"
|
grep
-v
null)'
-
'
echo
$ID'
-
'
echo
$ID'
# remove the package, as we want a new build even if the version number did not change
# remove the package, as we want a new build even if the version number did not change
-
'
curl
--max-time
900
--connect-timeout
120
--request
DELETE
--header
"PRIVATE-TOKEN:
${API_ACCES_TOKEN}"
"https://git.gfz-potsdam.de/api/v4/projects/${CI_PROJECT_ID}/packages/$ID"'
-
'
curl
--max-time
900
--connect-timeout
120
--request
DELETE
--header
"PRIVATE-TOKEN:
${API_ACCES_TOKEN}"
"https://git.gfz-potsdam.de/api/v4/projects/${CI_PROJECT_ID}/packages/$ID"'
...
...
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