Workaround Gitlab's package registry being stuck in the 80s

URL encoding isn't exactly groundbreaking technology, ffs
This commit is contained in:
Tristan 2022-06-07 12:49:24 +01:00
parent 3cb7de23c7
commit 2ad5d4cd47
No known key found for this signature in database
GPG Key ID: BDDFC4A0651ACDE4

View File

@ -174,14 +174,18 @@ deb:haproxy:
- make -C haproxy dist-deb
- |
set -euo pipefail
DEB_VERSION="$(cat haproxy/*.dsc | grep -E '^Version:' | cut -d' ' -f2-)"
echo "Publishing Debian package version ${DEB_VERSION}"
GITLAB_IS_LAME_DEB_VERSION=$(echo "${DEB_VERSION}" | tr '~' '-')
echo "Publishing Debian package version ${DEB_VERSION} to haproxy-debian@${GITLAB_IS_LAME_DEB_VERSION}"
for artifact in haproxy/haproxy*.deb; do
artifact_filename=$(basename "${artifact}")
echo "Uploading to haproxy-debian@${DEB_VERSION} - ${artifact_filename} ..."
gitlab_is_lame_artifact_filename=$(echo "${artifact_filename}" | tr '~' '-' | tr '+' '-')
echo "Uploading to haproxy-debian@${DEB_VERSION}... ${artifact_filename} -> ${gitlab_is_lame_artifact_filename}"
curl -fsSL -H"JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file "${artifact}" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/haproxy-debian/${DEB_VERSION}/${artifact_filename}"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/haproxy-debian/${GITLAB_IS_LAME_DEB_VERSION}/${gitlab_is_lame_artifact_filename}"
echo "OK"
done
needs: