Skip to content

Commit

Permalink
ci(aio): deploy previews early (right after build)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gkalpak committed May 11, 2017
1 parent decb4cc commit fec6c42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 12 additions & 1 deletion scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ travisFoldEnd "tsc a bunch of useless stuff"
if [[ ${CI_MODE:-} == "aio" ]]; then
travisFoldStart "build.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 -
travisFoldEnd "build.aio"
fi
5 changes: 1 addition & 4 deletions scripts/ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ case ${CI_MODE} in
cd ${TRAVIS_BUILD_DIR}/aio

if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
# This is a PR: deploy a snapshot for previewing (if preconditions met)
travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview
travisFoldEnd "deploy.aio.pr-preview"
# This is a PR: It has already been deployed in `build.sh`.
else
# This is upstream master: Deploy to staging
travisFoldStart "deploy.aio.staging"
Expand Down

0 comments on commit fec6c42

Please sign in to comment.