From fd1b586c6e43e94ebd5e7bbcb72c087fd27dede2 Mon Sep 17 00:00:00 2001 From: Bruck Wubete Date: Fri, 12 Oct 2018 16:11:22 -0400 Subject: [PATCH] Fixed #266 Externalize version tag so it is based on GitHub tag when deployed to production (GRN-1) (#292) * Update Jenkinsfile * updating Jenkinsfile * updating version in Jenkins * Update version.rb --- Jenkinsfile | 4 +++- config/initializers/version.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53e2c8b2..e8c64eaf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,10 +61,12 @@ volumes: [ withCredentials([file(credentialsId: 'cloud-datastore-user-account-creds', variable: 'FILE'), string(credentialsId: 'DOCKER_USER', variable: 'DOCKER_USER'), string(credentialsId: 'DOCKER_PASSWORD', variable: 'DOCKER_PASSWORD')]) { sh "gcloud auth activate-service-account --key-file=$FILE" if (stageBuild) { + sh "sed -i 's/VERSION =.*/VERSION = \"${gitBranch}\"/g' config/initializers/version.rb" sh "gcloud docker -- build -t ${imageTag} -t 'bigbluebutton/${appName}:master' . && gcloud docker -- push ${imageTag}" sh "docker login -u $DOCKER_USER -p $DOCKER_PASSWORD" sh "docker push 'bigbluebutton/${appName}:master'" } else if (releaseBuild) { + sh "sed -i 's/VERSION =.*/VERSION = \"${gitTag.substring(8)}\"/g' config/initializers/version.rb" imageTag = "gcr.io/${project}/${appName}:${gitTag}" sh "gcloud docker -- build -t ${imageTag} -t 'bigbluebutton/${appName}:${greenlightVersion}' -t 'bigbluebutton/${appName}:${gitTag}' . && gcloud docker -- push ${imageTag}" sh "docker login -u $DOCKER_USER -p $DOCKER_PASSWORD" @@ -91,4 +93,4 @@ volumes: [ slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' message: ${e} (${env.BUILD_URL})") } } -} +} \ No newline at end of file diff --git a/config/initializers/version.rb b/config/initializers/version.rb index 9933426f..4f36f6bc 100644 --- a/config/initializers/version.rb +++ b/config/initializers/version.rb @@ -2,6 +2,6 @@ module Greenlight class Application - VERSION = "2.0.0" + VERSION = "2" end end