ci(aio): add back deploy-preview

This commit is contained in:
Yuan Gao 2017-06-15 11:26:25 -07:00 committed by Matias Niemelä
parent fa85389f62
commit 1b0b69eeec
2 changed files with 10 additions and 9 deletions

View File

@ -21,6 +21,7 @@
"test-pwa-score": "node scripts/test-pwa-score", "test-pwa-score": "node scripts/test-pwa-score",
"example-e2e": "node ./tools/examples/run-example-e2e", "example-e2e": "node ./tools/examples/run-example-e2e",
"example-lint": "tslint -c \"content/examples/tslint.json\" \"content/examples/**/*.ts\" -e \"content/examples/styleguide/**/*.avoid.ts\"", "example-lint": "tslint -c \"content/examples/tslint.json\" \"content/examples/**/*.ts\" -e \"content/examples/styleguide/**/*.avoid.ts\"",
"deploy-preview": "scripts/deploy-preview.sh",
"deploy-staging": "scripts/deploy-to-firebase.sh staging", "deploy-staging": "scripts/deploy-to-firebase.sh staging",
"deploy-production": "scripts/deploy-to-firebase.sh production", "deploy-production": "scripts/deploy-to-firebase.sh production",
"check-env": "node scripts/check-environment", "check-env": "node scripts/check-environment",

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
set -u -e -o pipefail set -e -o pipefail
readonly TOKEN=$ANGULAR_PAYLOAD_FIREBASE_TOKEN readonly TOKEN=${ANGULAR_PAYLOAD_FIREBASE_TOKEN:-}
readonly PROJECT_NAME="angular-payload-size" readonly PROJECT_NAME="angular-payload-size"
source scripts/_payload-limits.sh source scripts/_payload-limits.sh
@ -47,15 +47,15 @@ timestamp=$(date +%s)
payloadData="$payloadData\"timestamp\": $timestamp, " payloadData="$payloadData\"timestamp\": $timestamp, "
# Add change source: application, dependencies, or 'application+dependencies' # Add change source: application, dependencies, or 'application+dependencies'
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE) allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE || "")
yarnChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep yarn.lock) yarnChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep yarn.lock || "")
if [[ $allChangedFiles ]] && [[ $yarnChangedFiles ]] && [ "$allChangedFiles" -ne "$yarnChangedFiles" ]; then if [[ ! -z $allChangedFiles ]] && [[ ! -z $yarnChangedFiles ]] && [ "$allChangedFiles" != "$yarnChangedFiles" ]; then
change='local+dependencies' change='application+dependencies'
elif [[ ! -z $yarnChangedFiles ]]; then elif [[ ! -z $yarnChangedFiles ]]; then
change='dependencies' change='dependencies'
elif [[ ! -z $allChangedFiles ]]; then elif [[ ! -z $allChangedFiles ]]; then
change='local' change='application'
else else
change='' change=''
fi fi
@ -65,10 +65,10 @@ payloadData="{${payloadData}}"
echo $payloadData echo $payloadData
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
firebase database:update --data "$payloadData" --project $PROJECT_NAME --confirm --token "$TOKEN" /payload/aio/$TRAVIS_COMMIT firebase database:update --data "$payloadData" --project $PROJECT_NAME --confirm --token "$TOKEN" /payload/aio/$TRAVIS_COMMIT
fi fi
if [ $failed = true ]; then if [[ $failed = true ]]; then
exit 1 exit 1
fi fi