Skip to content
Snippets Groups Projects
Verified Commit 04470343 authored by nd's avatar nd
Browse files

move mirror publishing to shared ci file

parent 1933fb22
No related branches found
No related tags found
No related merge requests found
Pipeline #8608 failed
...@@ -46,23 +46,19 @@ package:apt:bullseye: ...@@ -46,23 +46,19 @@ package:apt:bullseye:
- build:binary:bullseye - build:binary:bullseye
# for now, publish the bullseye package for buster as well # for now, publish the bullseye package for buster as well
publish:apt: publish:apt:buster:
extends: .publish extends: .publish:apt:
script: variables:
- echo "${CI_COMMIT_TAG}" | grep -qE "v[0-9]+[.][0-9]+[.][0-9]+.*" && export PACKAGE_VERSION="${CI_COMMIT_TAG#v}" || export PACKAGE_VERSION="${CI_COMMIT_SHA}" APTLY_DISTRO: buster
- export DEBPATH="$(echo *.deb)" dependencies:
- echo Ensure aptly repo exists - package:apt:bullseye
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST -H "Content-Type: application/json" --data "{\"Name\": \"${APT_REPO}\"}" "${APT_API_URL}/api/repos"' needs:
- echo Upload deb file, add it to repo and clean up upload - package:apt:bullseye
- curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST -F file=@"$DEBPATH" "${APT_API_URL}/api/files/${APT_REPO}-ci-upload-${CI_JOB_ID}"
- curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST "${APT_API_URL}/api/repos/${APT_REPO}/file/${APT_REPO}-ci-upload-${CI_JOB_ID}" publish:apt:bullseye:
- curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X DELETE "${APT_API_URL}/api/files/${APT_REPO}-ci-upload-${CI_JOB_ID}" extends: .publish:apt:
- echo Ensure aptly repo is published for all distros variables:
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST -H "Content-Type: application/json" --data "{\"SourceKind\": \"local\", \"Sources\": [{\"Name\": \"${APT_REPO}\"}], \"Architectures\": [\"amd64\"], \"Distribution\": \"buster\"}" "${APT_API_URL}/api/publish/${APT_REPO}"' APTLY_DISTRO: bullseye
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST -H "Content-Type: application/json" --data "{\"SourceKind\": \"local\", \"Sources\": [{\"Name\": \"${APT_REPO}\"}], \"Architectures\": [\"amd64\"], \"Distribution\": \"bullseye\"}" "${APT_API_URL}/api/publish/${APT_REPO}"'
- echo Update published repo for all distros
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X PUT -H "Content-Type: application/json" --data "{ }" "${APT_API_URL}/api/publish/${APT_REPO}/buster"'
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X PUT -H "Content-Type: application/json" --data "{ }" "${APT_API_URL}/api/publish/${APT_REPO}/bullseye"'
dependencies: dependencies:
- package:apt:bullseye - package:apt:bullseye
needs: needs:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment