Skip to content

Commit

Permalink
fix: use package version in prod hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sanchez committed Mar 9, 2022
1 parent 571033b commit 9b0fa3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions scripts/deploy_to_s3_bucket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions scripts/prepare_production_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9b0fa3e

Please sign in to comment.