diff --git a/scripts/deploy_to_s3_bucket.sh b/scripts/deploy_to_s3_bucket.sh index 338a6df59..3d3170fb0 100644 --- a/scripts/deploy_to_s3_bucket.sh +++ b/scripts/deploy_to_s3_bucket.sh @@ -3,11 +3,7 @@ function deploy_app { BUNDLE_FOLDER="build" - PACKAGE_VERSION=$(cat package.json \ - | grep version \ - | head -1 \ - | awk -F: '{ print $2 }' \ - | sed 's/[",]//g') + PACKAGE_VERSION=$(sed -nr 's/^\s*\"version": "([0-9]{1,}\.[0-9]{1,}.*)",$/\1/p' package.json) if [ -n "$APPEND_TAG" ] then diff --git a/scripts/prepare_production_deployment.sh b/scripts/prepare_production_deployment.sh index 2930241a5..b41651476 100755 --- a/scripts/prepare_production_deployment.sh +++ b/scripts/prepare_production_deployment.sh @@ -7,10 +7,12 @@ set -ev if [ -n "$PROD_DEPLOYMENT_HOOK_TOKEN" ] && [ -n "$PROD_DEPLOYMENT_HOOK_URL" ] then APP_NAME="$(basename $(pwd))" + PACKAGE_VERSION=$(sed -nr 's/^\s*\"version": "([0-9]{1,}\.[0-9]{1,}.*)",$/\1/p' package.json) curl --silent --output /dev/null --write-out "%{http_code}" -X POST \ -F token="$PROD_DEPLOYMENT_HOOK_TOKEN" \ -F ref=master \ -F "variables[TRIGGER_RELEASE_APP_NAME]=$APP_NAME" \ + -F "variables[TRIGGER_RELEASE_COMMIT_TAG]=$PACKAGE_VERSION" \ $PROD_DEPLOYMENT_HOOK_URL else echo "[ERROR] Production deployment could not be prepared"