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