diff --git a/config.ru b/config.ru index 630c057..f6175bf 100755 --- a/config.ru +++ b/config.ru @@ -226,7 +226,7 @@ pre {
-

Welcome to your Ruby application on OpenShift (version 31)

+

Welcome to your Ruby application on OpenShift (version {{BUILD_VERSION}})

diff --git a/deployment/pipeline.groovy b/deployment/pipeline.groovy index 096b7cc..7ab34fc 100644 --- a/deployment/pipeline.groovy +++ b/deployment/pipeline.groovy @@ -10,7 +10,12 @@ node() { def config = ocutil.parseConfig(readFile("deployment/config.yaml")) + 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}" + stage("Build") { + sh "sed -i '' 's/{{BUILD_VERSION}}/${buildVersion}/g' config.ru" ocutil.ocBuild("rubex-dev", "frontend", config.dev.build.frontend) } @@ -26,10 +31,6 @@ 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"