Skip to content

Commit

Permalink
bug in branch detection
Browse files Browse the repository at this point in the history
  • Loading branch information
gchandler authored and gchandler committed Oct 15, 2018
1 parent b6f3179 commit bd9bcf2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ if [ "$TRAVIS_PULL_REQUEST" == "true" ] || [ -z "CHANGE_ID" ]; then
exit 0
fi

# If using Jenkins
[ ! -z "$BRANCH_NAME" ] && branch=$BRANCH_NAME
# If using Travis
[ ! -z "$TRAVIS_BRANCH" ] && branch=$TRAVIS_BRANCH
# If the environment wasn't passed, determine it from the branch.
if [ -z "${environment}" ]; then
# If using Jenkins
[ ! -z "$BRANCH_NAME" ] && branch=$BRANCH_NAME
# If using Travis
[ ! -z "$TRAVIS_BRANCH" ] && branch=$TRAVIS_BRANCH
[ -z "${branch}" ] && echo "Unable to determine branch." && exit 1
# Deploy to staging if this is on the master branch.
[ ${branch} == "master" ] && environment=staging
[ ${branch} == "integration" ] && environment=integration
build_server=true
fi
[ -z "environment" ] && echo "Could not determine deployment environment." && exit 1

Expand Down

0 comments on commit bd9bcf2

Please sign in to comment.