forked from SonarSource/SonarJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·43 lines (32 loc) · 1.09 KB
/
travis.sh
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
38
39
40
41
42
43
#!/bin/bash
set -euo pipefail
function cleanJavaScriptInMavenRepository {
rm -rf ~/.m2/repository/org/sonarsource/javascript
}
function installTravisTools {
mkdir ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v16 | tar zx --strip-components 1 -C ~/.local
source ~/.local/bin/install
}
case "$TEST" in
ci)
mvn verify -B -e -V
;;
plugin|ruling|type-inference)
installTravisTools
cleanJavaScriptInMavenRepository # make sure we don't use an old version from the travis cache
mvn install -Dsource.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dmaven.test.skip=true
if [ "$SQ_VERSION" = "DEV" ] ; then
build_snapshot "SonarSource/sonarqube"
fi
cd its/$TEST
# "mvn package" and not "test" only because the test requires a custom plugin which is build in submodule "plugins"
# bfore the tests execution.
mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false package
cleanJavaScriptInMavenRepository # avoid adding snapshot to the travis cache
;;
*)
echo "Unexpected TEST mode: $TEST"
exit 1
;;
esac