2016-04-28 20:50:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
set -u -e -o pipefail
|
2016-04-28 20:50:03 -04:00
|
|
|
|
|
|
|
# Setup environment
|
2017-03-05 04:49:10 -05:00
|
|
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
|
|
|
source ${thisDir}/_travis-fold.sh
|
|
|
|
|
|
|
|
|
|
|
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
|
|
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
|
|
|
# https://docs.travis-ci.com/user/environment-variables/
|
|
|
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
|
|
|
exit 1;
|
|
|
|
fi
|
2016-04-28 20:50:03 -04:00
|
|
|
|
2017-07-21 05:48:04 -04:00
|
|
|
# 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"
|
2017-07-20 12:40:40 -04:00
|
|
|
exit 0;
|
|
|
|
fi
|
2017-02-09 12:08:16 -05:00
|
|
|
|
2017-08-09 17:21:10 -04:00
|
|
|
# Build the Angular packages then exit (no further build required)
|
|
|
|
if [[ ${CI_MODE:-} == "aio_e2e" ]]; then
|
|
|
|
travisFoldStart "build.aio_e2e"
|
|
|
|
(
|
|
|
|
./build.sh
|
|
|
|
)
|
|
|
|
travisFoldEnd "build.aio_e2e"
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "tsc tools"
|
|
|
|
$(npm bin)/tsc -p tools
|
2017-07-16 13:47:46 -04:00
|
|
|
$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig-build.json
|
|
|
|
cp packages/tsc-wrapped/package.json dist/packages-dist/tsc-wrapped
|
|
|
|
$(npm bin)/tsc -p packages/tsc-wrapped/tsconfig.json
|
|
|
|
cp packages/tsc-wrapped/package.json dist/all/@angular/tsc-wrapped
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldEnd "tsc tools"
|
2017-02-09 12:08:16 -05:00
|
|
|
|
|
|
|
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldStart "tsc all"
|
2017-07-16 13:47:46 -04:00
|
|
|
node --max-old-space-size=3000 dist/packages-dist/tsc-wrapped/src/main -p packages
|
|
|
|
node --max-old-space-size=3000 dist/packages-dist/tsc-wrapped/src/main -p modules
|
2017-03-02 03:22:24 -05:00
|
|
|
travisFoldEnd "tsc all"
|