Skip to content

Commit 5bee706

Browse files
committed
Makes npm-git push all branches to -preview
1 parent d991b64 commit 5bee706

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
- provider: script
5858
skip_cleanup: true
5959
script: ./resources/npm-git.sh
60-
on:
61-
branch: master
60+
# on: Commented out just for testing
61+
# branch:
62+
# - master
63+
# - 3.x
6264
- provider: npm
6365
skip_cleanup: true
6466
email:

resources/npm-git.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
# From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh
1010

1111
BUILD_DIR=latest
12+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
13+
TARGET="latest"
14+
if [ "$BRANCH" != "master" ];
15+
then
16+
TARGET="$BRANCH-preview"
17+
fi
1218

1319
npm run build
1420

@@ -29,5 +35,5 @@ git init
2935
git config user.name "Travis CI"
3036
git config user.email "[email protected]"
3137
git add .
32-
git commit -m "Deploy master to LATEST branch"
33-
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:latest
38+
git commit -m "Deploy $BRANCH to $TARGET branch"
39+
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:$TARGET

0 commit comments

Comments
 (0)