diff --git a/Jenkinsfile b/Jenkinsfile index 2d58fbd748f2fc0172b6592e50dfae6abffad288..75d94f66e4c4f95b8e1181d72fbbbb88bb69cb51 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 7569ff059f8f7d4aaff2fa0cccf62af42435059a..81e3624a0928a2e275a5889c086a6755ae6bd9f1 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"