diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b111041fd5411e0ea8c8e2a24c15623fd0ac5669..39c8e596c8001c2e001e9ee6b4f0341b4ed38f7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,23 +46,19 @@ package:apt:bullseye: - build:binary:bullseye # for now, publish the bullseye package for buster as well -publish:apt: - extends: .publish - script: - - 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}" - - export DEBPATH="$(echo *.deb)" - - echo Ensure aptly repo exists - - 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X POST -H "Content-Type: application/json" --data "{\"Name\": \"${APT_REPO}\"}" "${APT_API_URL}/api/repos"' - - echo Upload deb file, add it to repo and clean up upload - - 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}" - - curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X DELETE "${APT_API_URL}/api/files/${APT_REPO}-ci-upload-${CI_JOB_ID}" - - echo Ensure aptly repo is published for all distros - - '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}"' - - '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"' +publish:apt:buster: + extends: .publish:apt: + variables: + APTLY_DISTRO: buster + dependencies: + - package:apt:bullseye + needs: + - package:apt:bullseye + +publish:apt:bullseye: + extends: .publish:apt: + variables: + APTLY_DISTRO: bullseye dependencies: - package:apt:bullseye needs: