Skip to content

Commit 3d5d055

Browse files
Merge pull request #83 from ExpediaDotCom/0.2.3-SNAPSHOT
0.2.3 snapshot
2 parents bd01098 + 70ac02e commit 3d5d055

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.travis/deploy.sh

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

4-
if [ "$TRAVIS_BRANCH" != 'master' ] || [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
5-
echo "Skipping artifact deployment for a non-release build"
6-
exit 0
7-
fi
8-
9-
if [[ -z "$SONATYPE_USERNAME" || -z "$SONATYPE_PASSWORD" ]]; then
4+
if [ "${TRAVIS_BRANCH}" == 'master' -a "${TRAVIS_PULL_REQUEST}" == 'false' ] || [ -n "${TRAVIS_TAG}" ]; then
5+
if [[ -z "${SONATYPE_USERNAME}" || -z "${SONATYPE_PASSWORD}" ]]; then
106
echo "ERROR! Please set SONATYPE_USERNAME and SONATYPE_PASSWORD environment variable"
117
exit 1
12-
fi
8+
fi
139

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

21-
./mvnw --batch-mode --settings .travis/settings.xml -Prelease clean deploy -DskipTests=true -B -U
22-
SUCCESS=$?
23-
if [ ${SUCCESS} -eq 0 ]; then
17+
./mvnw --batch-mode --settings .travis/settings.xml -Prelease clean deploy -DskipTests=true -B -U
18+
SUCCESS=$?
19+
if [ ${SUCCESS} -eq 0 ]; then
2420
echo "successfully deployed the jars to nexus"
21+
fi
22+
23+
exit ${SUCCESS}
24+
else
25+
echo "Skipping artifact deployment for branch ${TRAVIS_BRANCH} with PR=${TRAVIS_PULL_REQUEST} and TAG=${TRAVIS_TAG}"
2526
fi
2627

27-
exit ${SUCCESS}
28+
exit 0

0 commit comments

Comments
 (0)