forked from SonarSource/sonar-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravis.sh
More file actions
executable file
·37 lines (27 loc) · 897 Bytes
/
travis.sh
File metadata and controls
executable file
·37 lines (27 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -euo pipefail
function installTravisTools {
mkdir ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v27 | tar zx --strip-components 1 -C ~/.local
source ~/.local/bin/install
}
installTravisTools
case "$TEST" in
ci)
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
# the profile "deploy-sonarsource" is defined in parent pom v28+
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
;;
*)
echo "Unexpected TEST mode: $TEST"
exit 1
;;
esac