Skip to content

Commit

Permalink
fix(deploy-firebase-instances): tolerate spaces in instance names + e…
Browse files Browse the repository at this point in the history
…xtract project id from exam-config
  • Loading branch information
adrienjoly committed May 18, 2018
1 parent 702ea6c commit df299bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/deploy-firebase-instances.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ do

echo # blank line
echo "* Building config data for $INSTANCE ..."
URL=`JS_TEST_INSTANCE=$INSTANCE node -e "console.log(require('$CONFIG_FILE').backend.FIREBASE_CONFIG.authDomain);"`
JS_TEST_INSTANCE=$INSTANCE npm run build --silent
PROJECT_ID=`JS_TEST_INSTANCE="$INSTANCE" node -e "console.log(require('$CONFIG_FILE').backend.FIREBASE_CONFIG.projectId);"`
URL="https://$PROJECT_ID.firebaseapp.com"
JS_TEST_INSTANCE="$INSTANCE" npm run build --silent

echo "* Creating temporary commit for config data ..."
git add --force public/scripts/exam-data.js
git commit -m 'Temporary Firebase-only deployment commit'

echo "* Deploying to instance: $URL ..."
firebase use $INSTANCE && firebase deploy
firebase use $PROJECT_ID && firebase deploy

echo "* Reverting temporary commit ..."
git reset --mixed HEAD~1
Expand Down

0 comments on commit df299bf

Please sign in to comment.