diff options
author | David Rautureau <david.rautureau@sonarsource.com> | 2017-01-06 11:49:13 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-01-11 11:20:36 +0100 |
commit | 3eda196582cc424b9c207f1424d7188f959d642c (patch) | |
tree | 0754502a14386e3c856cff984515e5da419b988e /travis.sh | |
parent | e6d78a732aba76e1a5ef330c1bf6565eb6775ee9 (diff) | |
download | sonarqube-3eda196582cc424b9c207f1424d7188f959d642c.tar.gz sonarqube-3eda196582cc424b9c207f1424d7188f959d642c.zip |
SONAR-8458 add build number when building on Travis
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/travis.sh b/travis.sh index 8ce6a7a0d5d..ac764993ee6 100755 --- a/travis.sh +++ b/travis.sh @@ -18,7 +18,7 @@ function installPhantomJs { function configureTravis { mkdir ~/.local - curl -sSL https://github.com/SonarSource/travis-utils/tarball/v31 | tar zx --strip-components 1 -C ~/.local + curl -sSL https://github.com/SonarSource/travis-utils/tarball/v33 | tar zx --strip-components 1 -C ~/.local source ~/.local/bin/install } configureTravis @@ -31,13 +31,6 @@ CI) MAVEN_OPTIONS="-Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -B -e -V" INITIAL_VERSION=`maven_expression "project.version"` - if [[ $INITIAL_VERSION =~ "-SNAPSHOT" ]]; then - echo "======= Found SNAPSHOT version =======" - # Do not deploy a SNAPSHOT version but the release version related to this build - set_maven_build_version $TRAVIS_BUILD_NUMBER - else - echo "======= Found RELEASE version =======" - fi if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo 'Analyse and trigger QA of master branch' @@ -49,6 +42,8 @@ CI) # For this reason errors are ignored with "|| true" git fetch --unshallow || true + . set_maven_build_version $TRAVIS_BUILD_NUMBER + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ $MAVEN_OPTIONS \ -Pdeploy-sonarsource \ @@ -59,7 +54,7 @@ CI) elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo 'release branch: trigger QA, no analysis' - export PROJECT_VERSION=`maven_expression "project.version"` + . set_maven_build_version $TRAVIS_BUILD_NUMBER mvn deploy \ $MAVEN_OPTIONS \ @@ -68,6 +63,8 @@ CI) elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then echo 'Internal pull request: trigger QA and analysis' + . set_maven_build_version $TRAVIS_BUILD_NUMBER + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ $MAVEN_OPTIONS \ -Dsource.skip=true \ |