From 19dbf232bb34ad04b2c775d4e2eca496d4f1228c Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 3 Jan 2019 12:38:25 +0200 Subject: [PATCH] Update travis scripts - Split sonarqube goal into its own script. Now sonar runs only after unit tests succeed. --- .travis.yml | 1 + scripts/runTests.sh | 13 +++---------- scripts/sonar.sh | 5 +++++ 3 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 scripts/sonar.sh diff --git a/.travis.yml b/.travis.yml index 18c7ec0e4..b4673dfc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ jobs: name: "Unit tests" before_script: bash scripts/prepareTestEnv.sh script: bash scripts/runTests.sh + after_success: bash scripts/sonar.sh - stage: "System Tests" name: "Test environment setup" script: bash scripts/prepareServerJars.sh diff --git a/scripts/runTests.sh b/scripts/runTests.sh index c0eab78b7..b79b77d72 100644 --- a/scripts/runTests.sh +++ b/scripts/runTests.sh @@ -1,10 +1,3 @@ -cd Plan - -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - gradle test --info -fi - -if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - gradle test --info - gradle sonarqube -fi +cd $HOME/Plan +gradle test --info +cd $HOME diff --git a/scripts/sonar.sh b/scripts/sonar.sh new file mode 100644 index 000000000..87b5b2cdf --- /dev/null +++ b/scripts/sonar.sh @@ -0,0 +1,5 @@ +cd $HOME/Plan +if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + gradle sonarqube +fi +cd $HOME