build: short-circuit build for AIO tasks

This commit is contained in:
Peter Bacon Darwin 2017-07-21 10:48:04 +01:00 committed by Alex Rickabaugh
parent 0f79223008
commit b5ffbe342b
1 changed files with 23 additions and 22 deletions

View File

@ -14,7 +14,29 @@ if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
exit 1;
fi
if [[ ${CI_MODE:-} == "bazel" ]]; then
# No build needed for bazel or aio docs tests
if [[ ${CI_MODE:-} == "bazel" || ${CI_MODE:-} == "docs_test" ]]; then
exit 0;
fi
# Build angular.io, then exit (no Angular build required)
if [[ ${CI_MODE:-} == "aio" ]]; then
travisFoldStart "build.aio"
(
cd "`dirname $0`/../../aio"
yarn build
# If this is a PR for angular/angular@master or angular/angular@<stable-branch>, deploy a
# snapshot for previewing early (if preconditions are met) regardless of the test outcome.
if [[ ${TRAVIS_REPO_SLUG} == "angular/angular" ]] &&
([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) &&
[[ $TRAVIS_PULL_REQUEST != "false" ]]; then
travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview -- --skip-build
travisFoldEnd "deploy.aio.pr-preview"
fi
)
travisFoldEnd "build.aio"
exit 0;
fi
@ -41,24 +63,3 @@ travisFoldStart "tsc a bunch of useless stuff"
node dist/packages-dist/tsc-wrapped/src/main -p packages/router/tsconfig-build.json
node dist/packages-dist/tsc-wrapped/src/main -p packages/forms/tsconfig-build.json
travisFoldEnd "tsc a bunch of useless stuff"
# Build angular.io
if [[ ${CI_MODE:-} == "aio" ]]; then
travisFoldStart "build.aio"
(
cd "`dirname $0`/../../aio"
yarn build
# If this is a PR for angular/angular@master or angular/angular@<stable-branch>, deploy a
# snapshot for previewing early (if preconditions are met) regardless of the test outcome.
if [[ ${TRAVIS_REPO_SLUG} == "angular/angular" ]] &&
([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) &&
[[ $TRAVIS_PULL_REQUEST != "false" ]]; then
travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview -- --skip-build
travisFoldEnd "deploy.aio.pr-preview"
fi
)
travisFoldEnd "build.aio"
fi