From 430a6a2a306abd0c99391e678b3d061979c6fb41 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 5 May 2017 14:31:54 +0200 Subject: 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 --- travis.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'travis.sh') 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 -- cgit v1.2.3