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",
"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\"",
"deploy-preview": "scripts/deploy-preview.sh",
"deploy-staging": "scripts/deploy-to-firebase.sh staging",
"deploy-production": "scripts/deploy-to-firebase.sh production",
"check-env": "node scripts/check-environment",

View File

@ -1,8 +1,8 @@
#!/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"
source scripts/_payload-limits.sh
@ -47,15 +47,15 @@ timestamp=$(date +%s)
payloadData="$payloadData\"timestamp\": $timestamp, "
# Add change source: application, dependencies, or 'application+dependencies'
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
yarnChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep yarn.lock)
allChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE || "")
yarnChangedFiles=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep yarn.lock || "")
if [[ $allChangedFiles ]] && [[ $yarnChangedFiles ]] && [ "$allChangedFiles" -ne "$yarnChangedFiles" ]; then
change='local+dependencies'
if [[ ! -z $allChangedFiles ]] && [[ ! -z $yarnChangedFiles ]] && [ "$allChangedFiles" != "$yarnChangedFiles" ]; then
change='application+dependencies'
elif [[ ! -z $yarnChangedFiles ]]; then
change='dependencies'
elif [[ ! -z $allChangedFiles ]]; then
change='local'
change='application'
else
change=''
fi
@ -65,10 +65,10 @@ payloadData="{${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
fi
if [ $failed = true ]; then
if [[ $failed = true ]]; then
exit 1
fi