Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit f7d0e40

Browse files
committed
build: conditional travis build stages
* Equivalent commit to angular/components#9949
1 parent 7699957 commit f7d0e40

File tree

4 files changed

+16
-38
lines changed

4 files changed

+16
-38
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ jobs:
2121
- env: "MODE=lint"
2222
- env: "MODE=aot"
2323
- env: "MODE=prerender"
24-
# Closure Compiler CI check is temporarily disabled until a new version of
25-
# the tool is released with https://github.com/google/closure-compiler/pull/2600
26-
# - env: "MODE=closure-compiler"
2724
- env: "MODE=saucelabs_required"
2825
- env: "MODE=browserstack_required"
2926
- env: "MODE=travis_required"
3027
- stage: Deploy
3128
env: "DEPLOY_MODE=build-artifacts"
29+
if: type = push
30+
# Closure Compiler CI check is temporarily disabled until a new version of
31+
# the tool is released with https://github.com/google/closure-compiler/pull/2600
32+
# - env: "MODE=closure-compiler"
3233
env:
3334
global:
3435
- LOGS_DIR=/tmp/flex-layout-build/logs

scripts/ci/travis-deploy.sh

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ cd $(dirname $0)/../..
1212
# Load the retry-call utility function.
1313
source scripts/retry-call.sh
1414

15-
# If the current Travis job is triggered by a pull request skip the deployment.
16-
# This check is necessary because Travis still tries to run the deploy build-stage for
17-
# pull requests.
18-
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
19-
echo "Build artifacts and docs content will only be deployed in Travis push builds."
20-
exit 0;
21-
fi
2215

2316
# Variable the specifies how often the deploy script should be invoked if it fails.
2417
DEPLOY_RETRIES=1
@@ -27,25 +20,12 @@ echo ""
2720
echo "Starting the deployment script. Running mode: ${DEPLOY_MODE}"
2821
echo ""
2922

30-
# Deployment of the screenshot tool or dashboard should happen inside of a Cronjob.
31-
# For example, always deploying the screenshot functions on a per-commit base might cause problems
32-
# with the screenshot tests, because the functions can be non-responsive for a few seconds.
33-
if [[ "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
34-
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
35-
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-screenshot-tool.sh
36-
fi
37-
38-
if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
39-
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-dashboard.sh
40-
fi
41-
# Deployment of the build artifacts and docs-content should only happen on a per-commit base.
42-
# The target is to provide build artifacts in the GitHub repository for every commit.
43-
else
44-
if [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
45-
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-build-artifacts.sh
46-
fi
47-
48-
if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
49-
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-docs-content.sh
50-
fi
23+
if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
24+
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-screenshot-tool.sh
25+
elif [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
26+
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/deploy-dashboard.sh
27+
elif [[ "${DEPLOY_MODE}" == "build-artifacts" ]]; then
28+
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-build-artifacts.sh
29+
elif [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
30+
retryCall ${DEPLOY_RETRIES} ./scripts/deploy/publish-docs-content.sh
5131
fi

scripts/ci/travis-env.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ if [[ -z "${TRAVIS}" ]]; then
55
exit 0
66
fi
77

8-
# If FIREBASE_ACCESS_TOKEN not set yet, export the FIREBASE_ACCESS_TOKEN using the JWT token that Travis generated and exported for SAUCE_ACCESS_KEY.
8+
# If FIREBASE_ACCESS_TOKEN not set yet, export the FIREBASE_ACCESS_TOKEN using the JWT token that
9+
# Travis generated and exported for SAUCE_ACCESS_KEY.
910
# This is a workaround for travis-ci/travis-ci#7223
1011
# WARNING: FIREBASE_ACCESS_TOKEN should NOT be printed
1112
export FIREBASE_ACCESS_TOKEN=${FIREBASE_ACCESS_TOKEN:-$SAUCE_ACCESS_KEY}
1213

13-
# - we overwrite the value set by Travis JWT addon here to work around travis-ci/travis-ci#7223 for FIREBASE_ACCESS_TOKEN
14+
# - we overwrite the value set by Travis JWT addon here to work around travis-ci/travis-ci#7223
15+
# for FIREBASE_ACCESS_TOKEN
1416
export SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987

scripts/ci/travis-script.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ set -e
99
# Go to project directory
1010
cd $(dirname $0)/../..
1111

12-
if [[ -z "$TRAVIS" ]]; then
13-
echo "This script can only run inside of Travis build jobs."
14-
exit 1
15-
fi
16-
1712
if [[ "${MODE}" ]]; then
1813
./scripts/ci/travis-testing.sh
1914
elif [[ "${DEPLOY_MODE}" ]]; then

0 commit comments

Comments
 (0)