Commit d75329a1 authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'uploadtagfix' into 'master'

More automatic upload fixes

See merge request !32
parents c1a4d349 b68f15bf
Pipeline #654 passed with stages
in 1 minute and 31 seconds
......@@ -48,7 +48,7 @@ make-install:
upload-tagged:
stage: install
only:
- /^v[0-9a-z\.]+@[0-9a-z]+/[0-9a-z]+$/
- /^v[0-9a-z\.]+@allworldit\/awit-ssh-client$/
script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
......@@ -63,11 +63,11 @@ upload-tagged:
# Create tar archive
- git archive --format=tar --prefix=${ARCHIVE_NAME}/ ${CI_BUILD_TAG} > ../${ARCHIVE_NAME}.tar
# Create compressed versions
- xz --keep --extreme -9 ../*.tar
- xz --keep --extreme -9 ../${ARCHIVE_NAME}.tar
# Sign compressed tar files
- gpg --sign --detach-sign --armor ../*.tar.xz
- gpg --sign --detach-sign --armor ../${ARCHIVE_NAME}.tar.xz
# Upload files, translating .asc into .sign
- lftp -e "set ssl:ca-file '/etc/ssl/certs/ca-certificates.crt'; set net:max-retries '5'; set net:timeout '60'; mkdir '${CI_BUILD_TAG}'; cd '${CI_BUILD_TAG}'; put ../'${ARCHIVE_NAME}.tar.xz' -o '${ARCHIVE_NAME}.tar.xz'; put ../'${ARCHIVE_NAME}.tar.xz.asc' -o '${ARCHIVE_NAME}.tar.xz.sign'; quit" -u "$UPLOAD_CRED" "$UPLOAD_HOST" 2>&1
- lftp -e "set ssl:ca-file '/etc/ssl/certs/ca-certificates.crt'; set net:max-retries '5'; set net:timeout '60'; rm -r -f '${CI_BUILD_TAG}'; mkdir '${CI_BUILD_TAG}'; cd '${CI_BUILD_TAG}'; put ../'${ARCHIVE_NAME}.tar.xz' -o '${ARCHIVE_NAME}.tar.xz'; put ../'${ARCHIVE_NAME}.tar.xz.asc' -o '${ARCHIVE_NAME}.tar.xz.sign'; quit" -u "$UPLOAD_CRED" "$UPLOAD_HOST" 2>&1
# Test uploaded files
- curl --fail -o /dev/null "$DOWNLOAD_URL/${CI_BUILD_TAG}/${ARCHIVE_NAME}.tar.xz"
- curl --fail -o /dev/null "$DOWNLOAD_URL/${CI_BUILD_TAG}/${ARCHIVE_NAME}.tar.xz.sign"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment