From fb5664359010e58ea1a8549735b0c0f747708aa2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 20 May 2017 11:17:35 +0200 Subject: [PATCH] Fix travis build for releases (refs #376) --- .travis.yml | 2 +- .travis/release.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 21d0d669b2..2de6aafd99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ deploy: on: tags: true repo: pmd/pmd - condition: "${TRAVIS_SECURE_ENV_VARS} = true" + condition: "${TRAVIS_SECURE_ENV_VARS} = true && ${BUILD} != sonar" after_deploy: bash .travis/release.sh notifications: diff --git a/.travis/release.sh b/.travis/release.sh index da293b6fd0..2508d891ac 100644 --- a/.travis/release.sh +++ b/.travis/release.sh @@ -1,6 +1,13 @@ #!/bin/bash set -e +echo "BUILD: $BUILD" +if [ "${BUILD}" != "deploy" ]; then + echo "Skipping deployment script, it needs to run only once" + exit 0 +fi + + RELEASE_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1) # Deploy to ossrh has already been done with the usual build. See build-deploy.sh