From bbd4efbf3d81151bdccb2f0d4b4fc5ba805aa94b Mon Sep 17 00:00:00 2001 From: Ovidio Mallo Date: Mon, 2 Jan 2017 14:25:23 +0100 Subject: [PATCH] Some cleanup --- deployment/pipeline.groovy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deployment/pipeline.groovy b/deployment/pipeline.groovy index 8af8aff..8069cea 100644 --- a/deployment/pipeline.groovy +++ b/deployment/pipeline.groovy @@ -1,16 +1,13 @@ @Library('ocutil') _ node() { + def gitVersionCmd = "mono /usr/local/GitVersion/GitVersion.exe" + stage("Checkout") { deleteDir() git(url: "https://github.com/omallo/ruby-ex.git", credentialsId: "github-omallo") } - def gitVersionCmd = "mono /usr/local/GitVersion/GitVersion.exe" - def buildVersion = sh(script: "${gitVersionCmd} /showvariable FullSemVer", returnStdout: true).trim() - def tagVersion = sh(script: "${gitVersionCmd} /showvariable MajorMinorPatch", returnStdout: true).trim() - echo "versions: buildVersion=${buildVersion}, tagVersion=${tagVersion}" - def config = ocutil.parseConfig(readFile("deployment/config.yaml")) stage("Build") { @@ -29,6 +26,10 @@ node() { if (isPromoteToTest) { stage("Deploy to TEST") { + def buildVersion = sh(script: "${gitVersionCmd} /showvariable FullSemVer", returnStdout: true).trim() + def tagVersion = sh(script: "${gitVersionCmd} /showvariable MajorMinorPatch", returnStdout: true).trim() + echo "versions: buildVersion=${buildVersion}, tagVersion=${tagVersion}" + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github-omallo', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD']]) { sh "git tag ${tagVersion}" sh "git push --tags https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/omallo/ruby-ex.git"