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

move mirror publishing to shared ci file

parent 8334f42f
Branches main
No related tags found
No related merge requests found
...@@ -73,3 +73,22 @@ image: registry.git.cccv.de/infra/packages/docker-images/utility ...@@ -73,3 +73,22 @@ image: registry.git.cccv.de/infra/packages/docker-images/utility
stage: publish stage: publish
rules: rules:
- if: '$RUN_AUTOUPDATE != "1" && $CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/' - if: '$RUN_AUTOUPDATE != "1" && $CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/'
.publish:apt:
extends: .publish
variables:
APTLY_ARCH: "amd64"
APTLY_DISTRO: "bullseye"
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\": [\"${APTLY_ARCH}\"], \"Distribution\": \"${APTLY_DISTRO}\"}" "${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}/${APTLY_DISTRO}"'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment