Skip to content
Snippets Groups Projects
Commit f1fe84f2 authored by George Sedov's avatar George Sedov
Browse files

work for manually-uploaded packages

parent 1b7e8dde
No related branches found
No related tags found
No related merge requests found
......@@ -374,7 +374,7 @@ upload-python-packages:
- echo "$NIMS_SSH_KNOWN_HOST" >> ~/.ssh/known_hosts
- pip install twine
- >
for pac_id in $(curl -s -G --header "JOB-TOKEN: $CI_JOB_TOKEN" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages -d package_type=pypi | python -c "import sys, json; [print(x['id']) for x in json.load(sys.stdin) if x['pipeline']['ref'] == '$CI_COMMIT_REF_NAME']"); do
for pac_id in $(curl -s -G --header "JOB-TOKEN: $CI_JOB_TOKEN" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages -d package_type=pypi | python -c "import sys, json; [print(x['id']) for x in json.load(sys.stdin) if ('pipeline' in x) and ('ref' in x['pipeline']) and (x['pipeline']['ref'] == '$CI_COMMIT_REF_NAME')]"); do
echo Removing package ${pac_id}
curl --request DELETE --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/${pac_id}"
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment