Skip to content

Commit

Permalink
Merge pull request #83 from ExpediaDotCom/0.2.3-SNAPSHOT
Browse files Browse the repository at this point in the history
0.2.3 snapshot
  • Loading branch information
keshavpeswani authored Jan 3, 2019
2 parents bd01098 + 70ac02e commit 3d5d055
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#!/bin/bash
cd `dirname $0`/..

if [ "$TRAVIS_BRANCH" != 'master' ] || [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
echo "Skipping artifact deployment for a non-release build"
exit 0
fi

if [[ -z "$SONATYPE_USERNAME" || -z "$SONATYPE_PASSWORD" ]]; then
if [ "${TRAVIS_BRANCH}" == 'master' -a "${TRAVIS_PULL_REQUEST}" == 'false' ] || [ -n "${TRAVIS_TAG}" ]; then
if [[ -z "${SONATYPE_USERNAME}" || -z "${SONATYPE_PASSWORD}" ]]; then
echo "ERROR! Please set SONATYPE_USERNAME and SONATYPE_PASSWORD environment variable"
exit 1
fi
fi

if [ ! -z "$TRAVIS_TAG" ]; then
echo "travis tag is set -> updating pom.xml <version> attribute to $TRAVIS_TAG"
./mvnw --batch-mode --settings .travis/settings.xml --no-snapshot-updates -Prelease -DskipTests=true -DreleaseVersion=$TRAVIS_TAG release:prepare
else
if [ ! -z "${TRAVIS_TAG}" ]; then
echo "travis tag is set -> updating pom.xml <version> attribute to ${TRAVIS_TAG}"
./mvnw --batch-mode --settings .travis/settings.xml --no-snapshot-updates -Prelease -DskipTests=true -DreleaseVersion=${TRAVIS_TAG} release:prepare
else
echo "no travis tag is set, hence keeping the snapshot version in pom.xml"
fi
fi

./mvnw --batch-mode --settings .travis/settings.xml -Prelease clean deploy -DskipTests=true -B -U
SUCCESS=$?
if [ ${SUCCESS} -eq 0 ]; then
./mvnw --batch-mode --settings .travis/settings.xml -Prelease clean deploy -DskipTests=true -B -U
SUCCESS=$?
if [ ${SUCCESS} -eq 0 ]; then
echo "successfully deployed the jars to nexus"
fi

exit ${SUCCESS}
else
echo "Skipping artifact deployment for branch ${TRAVIS_BRANCH} with PR=${TRAVIS_PULL_REQUEST} and TAG=${TRAVIS_TAG}"
fi

exit ${SUCCESS}
exit 0

0 comments on commit 3d5d055

Please sign in to comment.