chore(travis): detect branch correctly (again)

This commit is contained in:
Andy Joslin
2014-02-05 13:47:33 -05:00
parent 8b1a50415b
commit 383ebebca7

View File

@@ -31,24 +31,26 @@ function run {
echo "TRAVIS_COMMIT=$TRAVIS_COMMIT"
# Jshint & check for stupid mistakes
grunt jshint ddescribe-iit merge-conflict
# grunt jshint ddescribe-iit merge-conflict
# Run simple quick tests on Phantom to be sure any tests pass
grunt karma:single --browsers=PhantomJS --reporters=dots
# grunt karma:single --browsers=PhantomJS --reporters=dots
# Do sauce test with all browsers (takes longer)
# TODO Saucelabs settings need more tweaking before it becomes stable (sometimes it fails to connect)
# grunt karma:sauce --reporters=dots
GIT_BRANCH=$(git symbolic-ref HEAD --short)
if [[ "$GIT_BRANCH" != "master" ]]; then
echo "-- We are not on branch master, we are on branch $GIT_BRANCH. Will not push build out."
GIT_IS_MASTER=$(git symbolic-ref HEAD | grep master || echo false)
if [[ "$GIT_IS_MASTER" == "false" ]]; then
echo "-- We are not on branch master. Will not push build out."
exit 0
fi
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "-- This is a pull request build; will not push build out."
exit 0
fi
echo 'done'
exit 0
# If latest commit message starts with 'chore(release):' it's a release
COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT | head -c 15)