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
Branches
Tags
No related merge requests found
Pipeline #8608 failed
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment