This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +28
-15
lines changed
2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -53,22 +53,31 @@ jobs:
53
53
include :
54
54
- stage : deploy
55
55
# Don't deploy from PRs.
56
- # The deployment logic for pushed branches is defined in scripts\travis\build.sh
56
+ # This is a Travis-specific boolean language: https://docs.travis-ci.com/user/conditional-builds-stages-jobs#Specifying-conditions
57
+ # The deployment logic for pushed branches is further defined in scripts\travis\build.sh
57
58
if : type != pull_request
58
59
env :
59
60
- JOB=deploy
60
61
before_script : skip
61
62
script :
62
- - " ./scripts/travis/build.sh"
63
+ # Export the variables into the current process
64
+ - . ./scripts/travis/build.sh
65
+ - " echo DEPLOY_DOCS: $DEPLOY_DOCS, DEPLOY_CODE: $DEPLOY_CODE"
66
+ after_script : skip
63
67
# Work around the 10min Travis timeout so the code.angularjs firebase+gcs code deploy can complete
68
+ # Only run the keep_alive once (before_deploy is run for each provider)
64
69
before_deploy : |
65
- function keep_alive() {
66
- while true; do
67
- echo -en "\a"
68
- sleep 5
69
- done
70
- }
71
- keep_alive &
70
+ if ! [ "$BEFORE_DEPLOY_RUN" ]; then
71
+ export BEFORE_DEPLOY_RUN=1;
72
+
73
+ function keep_alive() {
74
+ while true; do
75
+ echo -en "\a"
76
+ sleep 10
77
+ done
78
+ }
79
+ keep_alive &
80
+ fi
72
81
deploy :
73
82
- provider : firebase
74
83
# the upload folder for firebase is configured in /firebase.json
78
87
on :
79
88
repo : angular/angular.js
80
89
all_branches : true
81
- condition : $DEPLOY_DOCS
90
+ condition : " $DEPLOY_DOCS == true "
82
91
- provider : gcs
83
92
skip_cleanup : true
84
93
access_key_id : GOOGLDB7W2J3LFHICF3R
90
99
on :
91
100
repo : angular/angular.js
92
101
all_branches : true
93
- condition : $DEPLOY_CODE
102
+ condition : " $DEPLOY_CODE == true "
94
103
Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ case "$JOB" in
36
36
export USE_JQUERY=1
37
37
fi
38
38
39
- export TARGET_SPECS=" build/docs/ptore2e/**/default_test.js"
40
-
41
39
if [[ " $TEST_TARGET " == jquery* ]]; then
42
40
TARGET_SPECS=" build/docs/ptore2e/**/jquery_test.js"
41
+ else
42
+ TARGET_SPECS=" build/docs/ptore2e/**/default_test.js"
43
43
fi
44
44
45
- export TARGET_SPECS=" test/e2e/tests/**/*.js,$TARGET_SPECS "
45
+ TARGET_SPECS=" test/e2e/tests/**/*.js,$TARGET_SPECS "
46
46
grunt test:travis-protractor --specs=" $TARGET_SPECS "
47
47
;;
48
48
" deploy" )
@@ -54,6 +54,8 @@ case "$JOB" in
54
54
# upload docs if the branch distTag from package.json is "latest" (i.e. stable branch)
55
55
if [[ " $DIST_TAG " == latest ]]; then
56
56
DEPLOY_DOCS=true
57
+ else
58
+ DEPLOY_DOCS=false
57
59
fi
58
60
59
61
# upload the build (code + docs) if ...
@@ -62,9 +64,11 @@ case "$JOB" in
62
64
# - or the branch distTag from package.json is "latest" (i.e. stable branch)
63
65
if [[ " $TRAVIS_TAG " != ' ' || " $TRAVIS_BRANCH " == master || " $DIST_TAG " == latest ]]; then
64
66
DEPLOY_CODE=true
67
+ else
68
+ DEPLOY_CODE=false
65
69
fi
66
70
67
- if [[ " $DEPLOY_DOCS " || " $DEPLOY_CODE " ]]; then
71
+ if [[ " $DEPLOY_DOCS " == true || " $DEPLOY_CODE " == true ]]; then
68
72
grunt prepareFirebaseDeploy
69
73
else
70
74
echo " Skipping deployment build because conditions have not been met."
You can’t perform that action at this time.
0 commit comments