Commit 0fbcf869 authored by Nigel Kukard's avatar Nigel Kukard

CI cleanup and standardization

parent ea0877d3
...@@ -58,9 +58,10 @@ sources-upload: ...@@ -58,9 +58,10 @@ sources-upload:
- apt-get install -y git xz-utils curl lftp gnupg - apt-get install -y git xz-utils curl lftp gnupg
- cd "$CI_PROJECT_DIR" - cd "$CI_PROJECT_DIR"
# Import signing key # Import signing key
- echo "$GPG_SIGNKEY" | gpg --import - echo "$SOURCES_GPG_SIGNKEY" | gpg --import
# Work out naming # 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 # Create tar archive
- git archive --format=tar --prefix=${ARCHIVE_NAME}/ ${CI_BUILD_TAG} > ../${ARCHIVE_NAME}.tar - git archive --format=tar --prefix=${ARCHIVE_NAME}/ ${CI_BUILD_TAG} > ../${ARCHIVE_NAME}.tar
# Create compressed versions # Create compressed versions
...@@ -68,10 +69,10 @@ sources-upload: ...@@ -68,10 +69,10 @@ sources-upload:
# Sign compressed tar files # Sign compressed tar files
- gpg --sign --detach-sign --armor ../${ARCHIVE_NAME}.tar.xz - gpg --sign --detach-sign --armor ../${ARCHIVE_NAME}.tar.xz
# Upload files, translating .asc into .sign # 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 # Test uploaded files
- curl --fail -o /dev/null "$DOWNLOAD_URL/${CI_BUILD_TAG}/${ARCHIVE_NAME}.tar.xz" - curl --fail -o /dev/null "$DOWNLOAD_URL/${SOURCE_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.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