From 97fee5365cf9947534a7d1fe4f064afcdee758ff Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Mon, 2 Jan 2017 02:24:18 +0000 Subject: [PATCH 1/4] Added gitattributes to prevent .gitlab-ci.yml being exported --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..817b160 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.gitlab-ci.yml export-ignore -- GitLab From 2b523f203e31f9f8f325e365dd7fb891a2f37598 Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Mon, 2 Jan 2017 02:25:08 +0000 Subject: [PATCH 2/4] Updated --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 817b160..a7affd6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ .gitlab-ci.yml export-ignore +.gitattributes export-ignore -- GitLab From e0c1047f099140a6433ad8e1f0206b43b6b81049 Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Mon, 2 Jan 2017 03:08:46 +0000 Subject: [PATCH 3/4] Removed TODO as we now have proper POD docs --- TODO | 1 - 1 file changed, 1 deletion(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index 70f96d5..0000000 --- a/TODO +++ /dev/null @@ -1 +0,0 @@ -* This now needs proper perl POD documentation -- GitLab From 6f29f2d52d8e04816f8a9c90be06cba9ec8b1f0c Mon Sep 17 00:00:00 2001 From: Nigel Kukard Date: Mon, 2 Jan 2017 03:09:00 +0000 Subject: [PATCH 4/4] Added tag build uploading --- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca7f069..83f5c4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - quality - tests - install + - upload @@ -44,3 +45,32 @@ make-install: +upload-tagged: + stage: install + only: + - /^v[0-9a-z\.]+@[0-9a-z]+/[0-9a-z]+$/ + script: + - export DEBIAN_FRONTEND=noninteractive + - apt-get update + - apt-get dist-upgrade -y + - apt-get install -y git xz curl lftp gnupg + - cd "$CI_PROJECT_DIR" + - make install + # Import signing key + - echo "$GPG_SIGNKEY" | gpg --import + # Work out naming + - ARCHIVE_NAME=${CI_PROJECT_NAME}-${CI_BUILD_TAG##v} + # Create tar archive + - git archive --format=tar --prefix=${ARCHIVE_NAME}/ ${CI_BUILD_TAG} > ../${ARCHIVE_NAME}.tar + # Create compressed versions + - xz --keep --extreme -9 ../*.tar + # Sign compressed tar files + - gpg --sign --detach-sign --armor ../*.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 + # 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" + + + -- GitLab