X Tutup
Skip to content

Commit 75ae4a9

Browse files
committed
ci(publish-build-artifacts.sh): skip all the work for builds other than upstream/master
Closes angular#7413
1 parent 37d18d0 commit 75ae4a9

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

scripts/publish/publish-build-artifacts.sh

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
#!/bin/bash
22
set -e -x
33

4-
DART_BUILD_ARTIFACTS_DIR="dist/pub/angular2"
5-
JS_BUILD_ARTIFACTS_DIR="dist/npm/angular2"
6-
7-
DART_BUILD_BRANCH="builds-dart"
8-
JS_BUILD_BRANCH="builds-js"
9-
10-
REPO_URL="https://github.com/angular/angular.git"
11-
# Use the below URL for testing when using SSH authentication
12-
# REPO_URL="git@github.com:angular/angular.git"
13-
14-
SHA=`git rev-parse HEAD`
15-
SHORT_SHA=`git rev-parse --short HEAD`
16-
COMMIT_MSG=`git log --oneline | head -n1`
17-
COMMITTER_USER_NAME=`git --no-pager show -s --format='%cN' HEAD`
18-
COMMITTER_USER_EMAIL=`git --no-pager show -s --format='%cE' HEAD`
194

205
function publishRepo {
216
LANG=$1
@@ -59,13 +44,34 @@ function publishRepo {
5944
)
6045
}
6146

47+
6248
if [[ "$TRAVIS_REPO_SLUG" == "angular/angular" && \
6349
"$TRAVIS_PULL_REQUEST" == "false" && \
6450
"$MODE" == "build_only" ]]; then
51+
52+
DART_BUILD_ARTIFACTS_DIR="dist/pub/angular2"
53+
JS_BUILD_ARTIFACTS_DIR="dist/npm/angular2"
54+
55+
DART_BUILD_BRANCH="builds-dart"
56+
JS_BUILD_BRANCH="builds-js"
57+
58+
REPO_URL="https://github.com/angular/angular.git"
59+
# Use the below URL for testing when using SSH authentication
60+
# REPO_URL="git@github.com:angular/angular.git"
61+
62+
SHA=`git rev-parse HEAD`
63+
SHORT_SHA=`git rev-parse --short HEAD`
64+
COMMIT_MSG=`git log --oneline | head -n1`
65+
COMMITTER_USER_NAME=`git --no-pager show -s --format='%cN' HEAD`
66+
COMMITTER_USER_EMAIL=`git --no-pager show -s --format='%cE' HEAD`
67+
6568
scripts/publish/npm_prepare.sh angular2
6669
publishRepo "js" "${JS_BUILD_ARTIFACTS_DIR}"
6770

6871
scripts/publish/pub_prepare.sh angular2
6972
publishRepo "dart" "${DART_BUILD_ARTIFACTS_DIR}"
7073
echo "Finished publishing build artifacts"
74+
75+
else
76+
echo "Not building the upstream/master branch, build artifacts won't be published."
7177
fi

0 commit comments

Comments
 (0)
X Tutup