forked from adfemg/sonarqube-ojaudit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testsonar.sh
executable file
·43 lines (31 loc) · 955 Bytes
/
testsonar.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 -u
# be sure to set SONAR_HOME before executing this script, for example:
# export SONAR_HOME=/Users/wilfred/sonar-3.7.3
SONAR_PROJ=`dirname $0`
echo
echo Stopping SonarQube...
$SONAR_HOME/bin/macosx-universal-64/sonar.sh stop
cd $SONAR_PROJ
echo
echo Removing $SONAR_PROJ/target...
rm -rf "$SONAR_PROJ/target"
echo
echo Running maven to build Sonar Plugin...
mvn license:format install
echo
echo Removing any previous version of our plugin from SonarQube...
rm -f $SONAR_HOME/extensions/plugins/sonar-ojaudit*.jar
echo
echo Copying generated JAR to SonarQube...
cp -a target/sonar-*.jar "$SONAR_HOME/extensions/plugins"
echo
echo Deleting H2 database for a clean start
rm $SONAR_HOME/data/*.db
echo
echo Starting SonarQube...
$SONAR_HOME/bin/macosx-universal-64/sonar.sh start
echo Wait for SonarQube to fully start...
sleep 33
echo starting Sonar-Runner...
export SONAR_RUNNER_OPTS=-Xmx1024M
$SONAR_HOME/bin/sonar-runner -e -X