diff --git a/.travis/deploy.sh b/.travis/deploy.sh index b1cdaa5..df01a31 100644 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -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 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