diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-07-19 12:34:58 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-07-20 15:34:01 +0200 |
commit | 92ab1dc3ea53612ebb8b309e8ecd3cb0580bb247 (patch) | |
tree | 5c413508e7914a1f8870aae57432f1946c55085f /travis.sh | |
parent | b06fb8e9b04ed583b38ecb5ebaaaa9822988dac4 (diff) | |
download | sonarqube-92ab1dc3ea53612ebb8b309e8ecd3cb0580bb247.tar.gz sonarqube-92ab1dc3ea53612ebb8b309e8ecd3cb0580bb247.zip |
Execute only Lite ITs on Travis
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 57 |
1 files changed, 24 insertions, 33 deletions
diff --git a/travis.sh b/travis.sh index 01655ab5080..5e038bf43aa 100755 --- a/travis.sh +++ b/travis.sh @@ -10,32 +10,30 @@ function configureTravis { configureTravis . installJDK8 -function strongEcho { - echo "" - echo "================ $1 =================" -} - case "$TARGET" in CI) - if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build and deploy' + export MAVEN_OPTS="-Xmx1G -Xms128m" + INITIAL_VERSION=`maven_expression "project.version"` + + if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo 'Analyse and trigger QA of master branch' # Do not deploy a SNAPSHOT version but the release version related to this build set_maven_build_version $TRAVIS_BUILD_NUMBER - # analysis is currently executed by SonarSource internal infrastructure - mvn deploy \ - -Pdeploy-sonarsource \ - -B -e -V - - elif [[ "${TRAVIS_BRANCH}" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - strongEcho 'Build and deploy' + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ + -Dsonar.host.url=$SONAR_HOST_URL \ + -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.projectVersion=$INITIAL_VERSION \ + -B -e -V - # get current version from pom - CURRENT_VERSION=`maven_expression "project.version"` + elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then + echo 'release branch: trigger QA, no analysis' - if [[ $CURRENT_VERSION =~ "-SNAPSHOT" ]]; then + 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 @@ -43,21 +41,19 @@ CI) echo "======= Found RELEASE version =======" fi - # analysis is currently executed by SonarSource internal infrastructure mvn deploy \ -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ -B -e -V - - elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then - strongEcho 'Build and analyze pull request, no deploy' + echo 'Internal pull request: trigger QA and analysis' - # 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. + set_maven_build_version $TRAVIS_BUILD_NUMBER - export MAVEN_OPTS="-Xmx1G -Xms128m" - mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \ + mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \ + -Pdeploy-sonarsource \ + -Dmaven.test.redirectTestOutputToFile=false \ -Dsonar.analysis.mode=issues \ -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ @@ -67,15 +63,16 @@ CI) -B -e -V else - strongEcho 'Build, no analysis, no deploy' + echo 'Feature branch or external pull request: no QA, no analysis' # 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 + + ./run-integration-tests.sh "Lite" "" ;; WEB) @@ -85,12 +82,6 @@ WEB) cd server/sonar-web && npm install && npm test ;; -IT) - start_xvfb - mvn install -DskipTests=true -Dsource.skip=true -Denforcer.skip=true -B -e -V - ./run-integration-tests.sh "$IT_CATEGORY" "" -Dmaven.test.redirectTestOutputToFile=false -Dexclude-qa-tests=true - ;; - *) echo "Unexpected TARGET value: $TARGET" exit 1 |