From 1ee6d27b1384b243f0b5d68a08add2281a22af08 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Thu, 12 Jul 2018 23:38:34 +0000
Subject: [PATCH] Parmeterize job

---
 Jenkinsfile                   | 9 +++++----
 scripts/hab-build-and-push.sh | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 2d58fbd74..75d94f66e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,11 +31,12 @@ pipeline {
     stage('build') {
       steps {
         script {
-          def baseAssetsPath = "https://assets-dev.reticium.io/"
-          def assetBundleServer = "https://assets-bundles-dev.reticium.io/"
-          def s3Destination = "s3://assets.reticulum-dev-7f8d39c45878ee2e/hubs"
-          def habCommand = "sudo /usr/bin/hab-docker-studio -k mozillareality run /bin/bash scripts/hab-build-and-push.sh ${baseAssetsPath} ${assetBundleServer} ${s3Destination}"
+          def baseAssetsPath = env.BASE_ASSETS_PATH
+          def assetBundleServer = env.ASSET_BUNDLE_SERVER
+          def targetS3Url = env.TARGET_S3_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}"
           sh "/usr/bin/script --return -c ${shellString(habCommand)} /dev/null"
         }
       }
diff --git a/scripts/hab-build-and-push.sh b/scripts/hab-build-and-push.sh
index 7569ff059..81e3624a0 100755
--- a/scripts/hab-build-and-push.sh
+++ b/scripts/hab-build-and-push.sh
@@ -2,7 +2,7 @@
 
 export BASE_ASSETS_PATH=$1
 export ASSET_BUNDLE_SERVER=$2
-export TARGET_S3_PATH=$3
+export TARGET_S3_URL=$3
 
 # To build + push to S3 run:
 # hab studio run "bash scripts/hab-build-and-push.sh"
@@ -31,5 +31,5 @@ GENERATE_SMOKE_TESTS=true yarn build --output-path build
 mkdir build/pages
 mv build/*.html build/pages
 
-aws s3 sync --acl public-read --cache-control "max-age=31556926" build/assets "$TARGET_S3_PATH/assets"
-aws s3 sync --acl public-read --cache-control "no-cache" --delete build/pages "$TARGET_S3_PATH/pages"
+aws s3 sync --acl public-read --cache-control "max-age=31556926" build/assets "$TARGET_S3_URL/assets"
+aws s3 sync --acl public-read --cache-control "no-cache" --delete build/pages "$TARGET_S3_URL/pages"
-- 
GitLab