From b4d33800806b8185cb07f40a81a21d380ed15fd1 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Fri, 13 Jul 2018 18:18:10 +0000
Subject: [PATCH] Add build version to build scripts

---
 Jenkinsfile                   | 4 ++--
 scripts/hab-build-and-push.sh | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index b01295d23..bf0317713 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -37,7 +37,7 @@ pipeline {
           def smokeURL = env.SMOKE_URL
           def slackURL = env.SLACK_URL
 
-          def habCommand = "sudo /usr/bin/hab-docker-studio -k mozillareality run /bin/bash scripts/hab-build-and-push.sh ${baseAssetsPath} ${assetBundleServer} ${targetS3Url}"
+          def habCommand = "sudo /usr/bin/hab-docker-studio -k mozillareality run /bin/bash scripts/hab-build-and-push.sh ${baseAssetsPath} ${assetBundleServer} ${targetS3Url} ${env.BUILD_NUMBER}"
           sh "/usr/bin/script --return -c ${shellString(habCommand)} /dev/null"
 
           def gitMessage = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'[%an] %s'").trim()
@@ -46,7 +46,7 @@ pipeline {
             "*<http://localhost:8080/job/${env.JOB_NAME}/${env.BUILD_NUMBER}|#${env.BUILD_NUMBER}>* *${env.JOB_NAME}* " +
             "<https://github.com/mozilla/hubs/commit/$gitSha|$gitSha> " +
             "Hubs: ```${gitSha} ${gitMessage}```\n" +
-            "<${smokeURL}?pollForSha=${gitSha}|Smoke Test> - to push:\n" +
+            "<${smokeURL}?require_version=${env.BUILD_NUMBER}|Smoke Test> - to push:\n" +
             "`/mr hubs deploy ${targetS3Url}`"
           )
           def payload = 'payload=' + JsonOutput.toJson([
diff --git a/scripts/hab-build-and-push.sh b/scripts/hab-build-and-push.sh
index af20058b3..2f04c0a26 100755
--- a/scripts/hab-build-and-push.sh
+++ b/scripts/hab-build-and-push.sh
@@ -3,6 +3,7 @@
 export BASE_ASSETS_PATH=$1
 export ASSET_BUNDLE_SERVER=$2
 export TARGET_S3_URL=$3
+export BUILD_VERSION=$4
 
 # To build + push to S3 run:
 # hab studio run "bash scripts/hab-build-and-push.sh"
-- 
GitLab