From 2e8bf74566bce699033a10c4187b0467c889b057 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein Date: Mon, 21 Mar 2022 14:21:47 +0100 Subject: [PATCH 1/4] #9 Try nightly deployment from development branch --- Jenkinsfile | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa68c29..1705e75 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,6 +47,14 @@ pipeline { timestamps() } + def getReleaseVersionFromTag(tag) { + if (tag == '') { + return 'nightly' + } else { + return tag + } + } + stages { stage('Build & Test') { steps { @@ -68,9 +76,9 @@ pipeline { BUILD_ARGS="-Pjenkins" # Configure 'sign' profile for build. - # Sign 'master' branch, to allow checking release signing before deployment. - # Sign releases. Determined based on release version tag name. - if [[ "$GIT_BRANCH" == "master" || "$TAG_NAME" =~ ^v[0-9]+\\.[0-9]+.*$ ]]; then + # Sign 'develop' branch, to allow release signing for 'nightly' deployment. + # Sign releases. Determined based on branch or release version tag name. + if [[ "$GIT_BRANCH" == "develop" || "$TAG_NAME" =~ ^v[0-9]+\\.[0-9]+.*$ ]]; then BUILD_ARGS="$BUILD_ARGS -Psign" fi @@ -103,6 +111,44 @@ pipeline { } } } + + stage('Deploy') { +/* + when { + anyOf { + branch 'develop' + tag pattern: "v\\d+\\.\\d+.*", comparator: "REGEXP" + } + } +*/ + environment { + DOWNLOADS_PATH = "/home/data/httpd/download.eclipse.org/trace4cps" + DOWNLOADS_URL = "genie.trace4cps@projects-storage.eclipse.org:${DOWNLOADS_PATH}" + WEBSITE_GIT_URL = "ssh://genie.trace4cps@git.eclipse.org:29418/www.eclipse.org/trace4cps.git" + RELEASE_VERSION = getReleaseVersionFromTag(env.TAG_NAME) + } + steps { + // Deploy downloads. + sh ''' + mkdir -p deploy/update-site/ + unzip -q releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip -d deploy/update-site/ + ''' + sshagent (['projects-storage.eclipse.org-bot-ssh']) { + // Remove any existing directory for this release. + sh 'ssh genie.trace4cps@projects-storage.eclipse.org rm -rf ${DOWNLOADS_PATH}/${RELEASE_VERSION}/' + + // Create directory for this release. + sh 'ssh genie.trace4cps@projects-storage.eclipse.org mkdir -p ${DOWNLOADS_PATH}/${RELEASE_VERSION}/' + + // Update site (archive). + sh 'scp -r releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip ${DOWNLOADS_URL}/${RELEASE_VERSION}/' + + // Update site (extracted). + sh 'ssh genie.trace4cps@projects-storage.eclipse.org mkdir -p ${DOWNLOADS_PATH}/${RELEASE_VERSION}/update-site/' + sh 'scp -r deploy/update-site/* ${DOWNLOADS_URL}/${RELEASE_VERSION}/update-site/' + } + } + } } post { -- GitLab From 074b8e687271e44e864484bfa3631e35227d2905 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein Date: Mon, 21 Mar 2022 14:30:05 +0100 Subject: [PATCH 2/4] #9 Moved function declaration --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1705e75..6655fba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,14 +47,6 @@ pipeline { timestamps() } - def getReleaseVersionFromTag(tag) { - if (tag == '') { - return 'nightly' - } else { - return tag - } - } - stages { stage('Build & Test') { steps { @@ -167,3 +159,11 @@ pipeline { } } } + +def getReleaseVersionFromTag(tag) { + if (tag == '') { + return 'nightly' + } else { + return tag + } +} -- GitLab From 0b5e18265dade4a58b6f8b28d45811e7d7571567 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein Date: Mon, 21 Mar 2022 14:50:19 +0100 Subject: [PATCH 3/4] #9 Trying nightly update site --- Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6655fba..568b78c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -100,6 +100,8 @@ pipeline { success { // Update site. archiveArtifacts 'releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip' + // Runtime verification CLI + archiveArtifacts 'temporallogic/org.eclipse.trace4cps.tl.cmd/target/*-dist.zip' } } } @@ -126,6 +128,8 @@ pipeline { unzip -q releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip -d deploy/update-site/ ''' sshagent (['projects-storage.eclipse.org-bot-ssh']) { + sh 'ssh genie.trace4cps@projects-storage.eclipse.org rm -rf ${DOWNLOADS_PATH}/null/' + // Remove any existing directory for this release. sh 'ssh genie.trace4cps@projects-storage.eclipse.org rm -rf ${DOWNLOADS_PATH}/${RELEASE_VERSION}/' @@ -138,6 +142,9 @@ pipeline { // Update site (extracted). sh 'ssh genie.trace4cps@projects-storage.eclipse.org mkdir -p ${DOWNLOADS_PATH}/${RELEASE_VERSION}/update-site/' sh 'scp -r deploy/update-site/* ${DOWNLOADS_URL}/${RELEASE_VERSION}/update-site/' + + // Runtime verification CLI + sh 'scp -r temporallogic/org.eclipse.trace4cps.tl.cmd/target/*-dist.zip ${DOWNLOADS_URL}/${RELEASE_VERSION}/' } } } @@ -161,7 +168,7 @@ pipeline { } def getReleaseVersionFromTag(tag) { - if (tag == '') { + if (tag == null) { return 'nightly' } else { return tag -- GitLab From 5aa9f42d2f417f9931dd075eecf383abe5efca12 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein Date: Mon, 21 Mar 2022 15:19:33 +0100 Subject: [PATCH 4/4] #9 Cleanup, only deploy develop branch (nightly) and tags --- Jenkinsfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 568b78c..702cf12 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -100,21 +100,17 @@ pipeline { success { // Update site. archiveArtifacts 'releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip' - // Runtime verification CLI - archiveArtifacts 'temporallogic/org.eclipse.trace4cps.tl.cmd/target/*-dist.zip' } } } stage('Deploy') { -/* when { anyOf { branch 'develop' tag pattern: "v\\d+\\.\\d+.*", comparator: "REGEXP" } } -*/ environment { DOWNLOADS_PATH = "/home/data/httpd/download.eclipse.org/trace4cps" DOWNLOADS_URL = "genie.trace4cps@projects-storage.eclipse.org:${DOWNLOADS_PATH}" @@ -128,8 +124,6 @@ pipeline { unzip -q releng/org.eclipse.trace4cps.repository/target/*-updatesite.zip -d deploy/update-site/ ''' sshagent (['projects-storage.eclipse.org-bot-ssh']) { - sh 'ssh genie.trace4cps@projects-storage.eclipse.org rm -rf ${DOWNLOADS_PATH}/null/' - // Remove any existing directory for this release. sh 'ssh genie.trace4cps@projects-storage.eclipse.org rm -rf ${DOWNLOADS_PATH}/${RELEASE_VERSION}/' @@ -142,9 +136,6 @@ pipeline { // Update site (extracted). sh 'ssh genie.trace4cps@projects-storage.eclipse.org mkdir -p ${DOWNLOADS_PATH}/${RELEASE_VERSION}/update-site/' sh 'scp -r deploy/update-site/* ${DOWNLOADS_URL}/${RELEASE_VERSION}/update-site/' - - // Runtime verification CLI - sh 'scp -r temporallogic/org.eclipse.trace4cps.tl.cmd/target/*-dist.zip ${DOWNLOADS_URL}/${RELEASE_VERSION}/' } } } -- GitLab