Skip to content

Commit

Permalink
configuration for travis-ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
frekele committed Aug 22, 2017
1 parent 303549a commit ad193fe
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
#!/bin/bash
cd `dirname $0`/..

if [ -z "${GPG_PASSPHRASE}" ]
then
echo "Error: Please set GPG_PASSPHRASE environment variable."
exit 1
fi

if [ -z "${SONATYPE_USERNAME}" ]
then
echo "error: please set SONATYPE_USERNAME environment variable"
echo "Error: Please set SONATYPE_USERNAME environment variable."
exit 1
fi

if [ -z "${SONATYPE_PASSWORD}" ]
then
echo "error: please set SONATYPE_PASSWORD environment variable"
echo "Error: Please set SONATYPE_PASSWORD environment variable."
exit 1
fi

if [ ! -z "${TRAVIS_TAG}" ]
then
echo "on a tag -> set pom.xml <version> to ${TRAVIS_TAG}"
echo "TRAVIS_TAG=${TRAVIS_TAG}."
echo "Setting new version into pom.xml to ${TRAVIS_TAG}."
#To avoid Travis error, you need to redirect output to / dev / null
${MVN_HOME}/bin/mvn --settings .travis/settings.xml versions:set -DnewVersion=${TRAVIS_TAG} 1>/dev/null 2>/dev/null
#${MVN_HOME}/bin/mvn --settings .travis/settings.xml clean deploy -DskipTests=true -B -U
echo "DEPLOYING RELEASE!"
${MVN_HOME}/bin/mvn --settings .travis/settings.xml clean deploy -DskipTests=true -B -U
echo "DEPLOYED RELEASE!"
else
echo "not on a tag -> keep snapshot version in pom.xml"
echo "Snapshot version in pom.xml."
echo "DEPLOYING SNAPSHOT!"
${MVN_HOME}/bin/mvn --settings .travis/settings.xml clean deploy -DskipTests=true -B -U
echo "DEPLOYED SNAPSHOT!"
fi

0 comments on commit ad193fe

Please sign in to comment.