diff --git a/.travis.yml b/.travis.yml index 43f058f904..05ab35cae8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/resources/npm-git.sh b/resources/npm-git.sh index 7fa1dd0642..d0442ffc85 100755 --- a/resources/npm-git.sh +++ b/resources/npm-git.sh @@ -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 @@ -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