diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-16 21:26:54 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-16 21:28:01 +0100 |
commit | 6dcf5f86801005d810d895e881d21b7181e4473e (patch) | |
tree | 9907a526c76b7654b361fe4d766442fd1782c9a9 /travis.sh | |
parent | 32b0ebc87b48fb4ed1aa79758d25268911f5866d (diff) | |
download | sonar-scanner-cli-6dcf5f86801005d810d895e881d21b7181e4473e.tar.gz sonar-scanner-cli-6dcf5f86801005d810d895e881d21b7181e4473e.zip |
Fix Travis configuration
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 77 |
1 files changed, 7 insertions, 70 deletions
@@ -4,81 +4,18 @@ set -euo pipefail function configureTravis { mkdir -p ~/.local - curl -sSL https://github.com/SonarSource/travis-utils/tarball/v23 | tar zx --strip-components 1 -C ~/.local + curl -sSL https://github.com/SonarSource/travis-utils/tarball/v27 | tar zx --strip-components 1 -C ~/.local source ~/.local/bin/install } configureTravis -function strongEcho { - echo "" - echo "================ $1 =================" -} - -case "$TARGET" in - -CI) - if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build, deploy and analyze master' - - SONAR_PROJECT_VERSION=`maven_expression "project.version"` - - # Do not deploy a SNAPSHOT version but the release version related to this build - set_maven_build_version $TRAVIS_BUILD_NUMBER - - export MAVEN_OPTS="-Xmx1G -Xms128m" - mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ - -Pcoverage-per-test,deploy-sonarsource \ - -Dmaven.test.redirectTestOutputToFile=false \ - -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.login=$SONAR_TOKEN \ - -Dsonar.projectVersion=$SONAR_PROJECT_VERSION \ - -B -e -V - - elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then - strongEcho 'Build and analyze pull request, no deploy' - - # No need for Maven phase "install" as the generated JAR file does not need to be installed - # in Maven local repository. Phase "verify" is enough. - - mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \ - -Dmaven.test.redirectTestOutputToFile=false \ - -Dsonar.analysis.mode=issues \ - -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ - -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ - -Dsonar.github.oauth=$GITHUB_TOKEN \ - -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.login=$SONAR_TOKEN \ - -B -e -V - - else - strongEcho 'Build, no analysis, no deploy' - - # No need for Maven phase "install" as the generated JAR file does not need to be installed - # in Maven local repository. Phase "verify" is enough. - - mvn verify \ - -Dmaven.test.redirectTestOutputToFile=false \ - -B -e -V - fi - ;; +regular_mvn_build_deploy_analyze -IT) - if [ "${SQ_VERSION}" = "DEV" ] - then - build_snapshot "SonarSource/sonarqube" - fi - # Need install because ITs will take artifact from local repo - mvn install -B -e -V -Dsource.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dmaven.test.skip=true - - cd it - - mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -e -B -V - ;; +MIN_SQ_VERSION="LTS" +echo '======= Run integration tests on minimal supported version of SonarQube ($MIN_SQ_VERSION)' +cd it +mvn -Dsonar.runtimeVersion="$MIN_SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -e -B -V -*) - echo "Unexpected TARGET value: $TARGET" - exit 1 - ;; -esac +# all other versions of SQ are tested by the QA pipeline at SonarSource |