Skip to content

Commit cdb8528

Browse files
Ashish AggarwalAshish Aggarwal
authored andcommitted
adding a fix for travis issue [ref HEAD is not a symbolic ref]
1 parent 6fb7a44 commit cdb8528

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.travis/deploy.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#!/bin/bash
22
cd `dirname $0`/..
33

4+
function fix_git {
5+
echo "Fixing git setup for $TRAVIS_BRANCH"
6+
git checkout ${TRAVIS_BRANCH}
7+
git branch -u origin/${TRAVIS_BRANCH}
8+
git config branch.${TRAVIS_BRANCH}.remote origin
9+
git config branch.${TRAVIS_BRANCH}.merge refs/heads/${TRAVIS_BRANCH}
10+
}
11+
12+
413
if [ "${TRAVIS_BRANCH}" == 'master' -a "${TRAVIS_PULL_REQUEST}" == 'false' ] || [ -n "${TRAVIS_TAG}" ]; then
514
if [[ -z "${SONATYPE_USERNAME}" || -z "${SONATYPE_PASSWORD}" ]]; then
615
echo "ERROR! Please set SONATYPE_USERNAME and SONATYPE_PASSWORD environment variable"
716
exit 1
817
fi
918

1019
if [ ! -z "${TRAVIS_TAG}" ]; then
20+
fix_git
1121
echo "travis tag is set -> updating pom.xml <version> attribute to ${TRAVIS_TAG}"
1222
./mvnw --batch-mode --settings .travis/settings.xml -DskipTests=true -DreleaseVersion=${TRAVIS_TAG} release:clean release:prepare release:perform
1323
SUCCESS=$?

0 commit comments

Comments
 (0)