Skip to content

Commit

Permalink
[Bug 1462795] auto deploy tag broken
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldwoo authored and fbertsch committed May 22, 2018
1 parent c508fa6 commit e3700dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ if [[ -z "$TRAVIS_TAG" ]]; then
else
# Only continue uploading jar if the tag was on master branch
pushd ${TRAVIS_BUILD_DIR}
# Finds all branches that contain the commit sha of TRAVIS_TAG

# Travis workers on tagged builds are in detached head state with only tag references
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch
git checkout remotes/origin/master

# Finds all branches that contain the commit sha of TRAVIS_TAG. This only will work on master branch
output=$(git branch -r --contains `git rev-parse --verify ${TRAVIS_TAG}^{commit}`)

if [[ $output =~ .*origin\/master.* ]]; then
Expand All @@ -33,6 +39,8 @@ else
# Exit 0 so the travis build doesn't fail
exit 0
fi
# Restore to previous checkout and directory
git checkout -
popd
BRANCH_OR_TAG=tags
ID=$TRAVIS_TAG
Expand Down

0 comments on commit e3700dd

Please sign in to comment.