Skip to content
Snippets Groups Projects
Commit a93c6db2 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Update .gitlab-ci.yml file

parent 1b52e112
No related branches found
No related tags found
No related merge requests found
...@@ -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"'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment