From df299bfe7eb8431981b226debb6d65a5a96606b9 Mon Sep 17 00:00:00 2001 From: Adrien Joly <531781+adrienjoly@users.noreply.github.com> Date: Fri, 18 May 2018 17:20:18 +0200 Subject: [PATCH] fix(deploy-firebase-instances): tolerate spaces in instance names + extract project id from exam-config --- src/deploy-firebase-instances.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/deploy-firebase-instances.sh diff --git a/src/deploy-firebase-instances.sh b/src/deploy-firebase-instances.sh old mode 100755 new mode 100644 index 454a507..6b70b10 --- a/src/deploy-firebase-instances.sh +++ b/src/deploy-firebase-instances.sh @@ -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