ci(aio): deploy previews early (right after build) (#16734)

Previously, PR previews were deployed after successfully running all tests.
While this makes sense for staging/production deployments, previews should be
available as soon as possible (and regardless of the outcome of tests).

Fixes #16705
This commit is contained in:
George Kalpakas 2017-05-12 01:12:23 +03:00 committed by Igor Minar
parent decb4cc4a3
commit fdfeaaf1f3
2 changed files with 13 additions and 5 deletions

View File

@ -41,7 +41,18 @@ travisFoldEnd "tsc a bunch of useless stuff"
if [[ ${CI_MODE:-} == "aio" ]]; then if [[ ${CI_MODE:-} == "aio" ]]; then
travisFoldStart "build.aio" travisFoldStart "build.aio"
cd "`dirname $0`/../../aio" cd "`dirname $0`/../../aio"
yarn run build yarn build
# If this is a PR for angular/angular@master, 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_PULL_REQUEST != "false" ]]; then
travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview -- --skip-build
travisFoldEnd "deploy.aio.pr-preview"
fi
cd - cd -
travisFoldEnd "build.aio" travisFoldEnd "build.aio"
fi fi

View File

@ -51,10 +51,7 @@ case ${CI_MODE} in
cd ${TRAVIS_BUILD_DIR}/aio cd ${TRAVIS_BUILD_DIR}/aio
if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
# This is a PR: deploy a snapshot for previewing (if preconditions met) # This is a PR: It has already been deployed in `build.sh`.
travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview
travisFoldEnd "deploy.aio.pr-preview"
else else
# This is upstream master: Deploy to staging # This is upstream master: Deploy to staging
travisFoldStart "deploy.aio.staging" travisFoldStart "deploy.aio.staging"