diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index 3268d989c5..080edba2bd 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -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@, 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 @@ -38,24 +60,3 @@ travisFoldStart "tsc a bunch of useless stuff" node dist/tools/@angular/tsc-wrapped/src/main -p packages/router/tsconfig-build.json node dist/tools/@angular/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@, 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