Skip to content

Commit

Permalink
Makes npm-git push all branches to -preview
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Oct 21, 2017
1 parent d991b64 commit 5bee706
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ jobs:
- provider: script
skip_cleanup: true
script: ./resources/npm-git.sh
on:
branch: master
# on: Commented out just for testing
# branch:
# - master
# - 3.x
- provider: npm
skip_cleanup: true
email:
Expand Down
10 changes: 8 additions & 2 deletions resources/npm-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh

BUILD_DIR=latest
BRANCH=$(git rev-parse --abbrev-ref HEAD)
TARGET="latest"
if [ "$BRANCH" != "master" ];
then
TARGET="$BRANCH-preview"
fi

npm run build

Expand All @@ -29,5 +35,5 @@ git init
git config user.name "Travis CI"
git config user.email "github@fb.com"
git add .
git commit -m "Deploy master to LATEST branch"
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:latest
git commit -m "Deploy $BRANCH to $TARGET branch"
git push --force --quiet "https://${GH_TOKEN}@github.com/parse-community/parse-server.git" master:$TARGET

0 comments on commit 5bee706

Please sign in to comment.