Commit 784f577c authored by Nigel Kukard's avatar Nigel Kukard

Merge branch 'cifix7' into 'master'

CI cleanup and standardization

See merge request !39
parents ea0877d3 0fbcf869
Pipeline #714 passed with stages
in 1 minute and 17 seconds
......@@ -58,9 +58,10 @@ sources-upload:
- apt-get install -y git xz-utils curl lftp gnupg
- cd "$CI_PROJECT_DIR"
# Import signing key
- echo "$GPG_SIGNKEY" | gpg --import
- echo "$SOURCES_GPG_SIGNKEY" | gpg --import
# Work out naming
- export ARCHIVE_NAME=${CI_PROJECT_NAME}-${CI_BUILD_TAG##v}
- export SOURCE_TAG="${CI_BUILD_TAG%%-*}"
- export ARCHIVE_NAME=${CI_PROJECT_NAME}-${SOURCE_TAG##v}
# Create tar archive
- git archive --format=tar --prefix=${ARCHIVE_NAME}/ ${CI_BUILD_TAG} > ../${ARCHIVE_NAME}.tar
# Create compressed versions
......@@ -68,10 +69,10 @@ sources-upload:
# Sign compressed tar files
- 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'; rm -r -f '${CI_BUILD_TAG}'; mkdir '${CI_BUILD_TAG}' && put ../'${ARCHIVE_NAME}.tar.xz' -o '${CI_BUILD_TAG}/${ARCHIVE_NAME}.tar.xz' && put ../'${ARCHIVE_NAME}.tar.xz.asc' -o '${CI_BUILD_TAG}/${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 '${SOURCE_TAG}'; mkdir '${SOURCE_TAG}' && put ../'${ARCHIVE_NAME}.tar.xz' -o '${SOURCE_TAG}/${ARCHIVE_NAME}.tar.xz' && put ../'${ARCHIVE_NAME}.tar.xz.asc' -o '${SOURCE_TAG}/${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"
- curl --fail -o /dev/null "$DOWNLOAD_URL/${SOURCE_TAG}/${ARCHIVE_NAME}.tar.xz"
- curl --fail -o /dev/null "$DOWNLOAD_URL/${SOURCE_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