Skip to content

Commit 81ad062

Browse files
committed
set disttag in travis build
1 parent 242c787 commit 81ad062

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ notifications:
4848
jobs:
4949
include:
5050
- stage: deploy
51-
script: grunt package && grunt compress:uploadBuild && echo "branch" && echo $TRAVIS_BRANCH && echo "pull request" && echo $TRAVIS_PULL_REQUEST && echo "tag" && echo $TRAVIS_TAG && echo "DIST_TAG" && echo $DIST_TAG
5251
before_script: skip
5352
before_deploy: |
5453
function keep_alive() {
@@ -67,7 +66,7 @@ jobs:
6766
secure: $FIREBASE_TOKEN
6867
on:
6968
repo: angular/angular.js
70-
condition: $TRAVIS_TAG != '' && cat package.json | jq '.distTag' = latest
69+
condition: $TRAVIS_TAG = '' && $DISTTAG = next
7170
all_branches: true
7271
- provider: gcs
7372
access_key_id: GOOGLDB7W2J3LFHICF3R

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ module.exports = function(grunt) {
326326
dot: true,
327327
dest: dist + '/'
328328
},
329-
uploadBuild: {
329+
firebaseCodeDeploy: {
330330
options: {
331331
mode: 'gzip'
332332
},

scripts/travis/before_build.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
set -e
44

5-
DISTTAG=$( cat package.json | jq '.distTag' | tr -d \" )
6-
7-
echo $TRAVIS_TAG
8-
echo $DISTTAG
9-
10-
if [[ $TRAVIS_TAG = '' && $DISTTAG = "next" ]]; then
11-
echo "read from json";
12-
fi
13-
145
yarn global add grunt-cli@1.2.0
156

167
mkdir -p $LOGS_DIR

scripts/travis/build.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ set -e
55
export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev`
66
export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
77

8-
DISTTAG=$( cat package.json | jq '.distTag' )
9-
10-
echo $TRAVIS_TAG
11-
echo $DISTTAG
12-
13-
if [[ $DISTTAG = "next" ]]; then
14-
echo "read from json";
15-
fi
16-
178
if [ "$JOB" == "ci-checks" ]; then
189
grunt ci-checks
1910
elif [ "$JOB" == "unit" ]; then
@@ -40,6 +31,12 @@ elif [ "$JOB" == "e2e" ]; then
4031

4132
export TARGET_SPECS="test/e2e/tests/**/*.js,$TARGET_SPECS"
4233
grunt test:travis-protractor --specs="$TARGET_SPECS"
34+
elif [ "$JOB" == "deploy" ]; then
35+
# the DISTTAG is read by the deploy config
36+
export DISTTAG=$( cat package.json | jq '.distTag' | tr -d \"[:space:] )
37+
38+
grunt package
39+
grunt compress:firebaseCodeDeploy
4340
else
44-
echo "Unknown job type. Please set JOB=ci-checks, JOB=unit or JOB=e2e-*."
41+
echo "Unknown job type. Please set JOB=ci-checks, JOB=unit, JOB=deploy or JOB=e2e-*."
4542
fi

0 commit comments

Comments
 (0)