From 8882631edc7596737fd1bec66499671b4949cc6a Mon Sep 17 00:00:00 2001 From: roxedus Date: Sat, 27 Jul 2019 02:32:02 +0200 Subject: [PATCH] Refined jenkins process More tagging Releases! --- Jenkinsfile | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 09eea56..12f8f57 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,18 +33,19 @@ pipeline { script { if (BRANCH_NAME == 'master') { def image = docker.build("${DOCKER_REPO}:${TAG}-amd64") - image.push() - } + image.push("${TAG}-amd64") + image.push("latest-amd64") + } + else { def image = docker.build("${DOCKER_REPO}:${SBranch}-amd64") image.push() + } } } } stage('pr') { agent { label 'amd64'} - when { - changeRequest() - } + when { changeRequest() } steps { script { def image = docker.build("${DOCKER_REPO}:PR_$GIT_BRANCH-amd64") @@ -53,5 +54,18 @@ pipeline { } } } + stage('GitHub Release') { + when { branch 'master' } + agent { label 'amd64'} + steps { + withCredentials([usernameColonPassword(credentialsId: 'RoxBot-Dev Github', variable: 'GitCred')]) { + sh """ + git remote set-url origin "https://${GitCred}@github.com/${GIT_REPO}.git" + git tag ${TAG} + git push --tags + """ + } + } + } } }