diff options
author | Tom <thomas.verin@sonarsource.com> | 2017-05-05 14:31:54 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-05-26 11:56:39 +0200 |
commit | 430a6a2a306abd0c99391e678b3d061979c6fb41 (patch) | |
tree | 49723a641b4ccb97a7ff5f0487b532b8358f0b63 /travis.sh | |
parent | 2fbb2d7a6c766e7a33fbae4811eb3de160cd1f07 (diff) | |
download | sonarqube-430a6a2a306abd0c99391e678b3d061979c6fb41.tar.gz sonarqube-430a6a2a306abd0c99391e678b3d061979c6fb41.zip |
Use Trusty image on TravisCI
- environment is more stable through time (no variations of build
durations)
- benefit from 8Gb ramdisk
- enable parallel Maven build thanks to new CPUs
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/travis.sh b/travis.sh index e76c29285ed..b317f298813 100755 --- a/travis.sh +++ b/travis.sh @@ -1,6 +1,8 @@ #!/bin/bash set -euo pipefail +./.travis/setup_ramdisk.sh + function installPhantomJs { echo "Setup PhantomJS 2.1" mkdir -p ~/phantomjs @@ -111,7 +113,7 @@ function fixBuildVersion { # Configure Maven settings and install some script utilities # function configureTravis { - mkdir ~/.local + mkdir -p ~/.local curl -sSL https://github.com/SonarSource/travis-utils/tarball/v36 | tar zx --strip-components 1 -C ~/.local source ~/.local/bin/install } @@ -126,17 +128,13 @@ case "$TARGET" in BUILD) - # Hack to keep job alive even if no logs during more than 10 minutes. - # That can occur when uploading sonarqube.zip to Artifactory. - ./clock.sh & - installJdk8 installMaven fixBuildVersion # Minimal Maven settings export MAVEN_OPTS="-Xmx1G -Xms128m" - MAVEN_ARGS="-Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -B -e -V -DbuildVersion=$BUILD_VERSION" + MAVEN_ARGS="-T 1C -Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -B -e -V -DbuildVersion=$BUILD_VERSION" if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo 'Build and analyze master' @@ -148,13 +146,15 @@ BUILD) # For this reason errors are ignored with "|| true" git fetch --unshallow || true - mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy \ $MAVEN_ARGS \ - -Pdeploy-sonarsource,release \ + -Pdeploy-sonarsource,release + mvn sonar:sonar \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.login=$SONAR_TOKEN \ -Dsonar.projectVersion=$INITIAL_VERSION + elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo 'Build release branch' @@ -163,10 +163,11 @@ BUILD) elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then echo 'Build and analyze internal pull request' - mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy \ $MAVEN_ARGS \ -Dsource.skip=true \ - -Pdeploy-sonarsource \ + -Pdeploy-sonarsource + mvn sonar:sonar \ -Dsonar.analysis.mode=preview \ -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ @@ -198,6 +199,3 @@ WEB_TESTS) ;; esac - -#stop the clock -touch stop |