forked from SonarSource/sonarqube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·36 lines (31 loc) · 986 Bytes
/
start.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
#!/bin/bash
###############################
# usage: use -d option to enable remote debugging of the web server on port 5005
###############################
if [[ "$OSTYPE" == "darwin"* ]]; then
OS='macosx-universal-64'
SED_DISABLE_BACKUP=" ''"
else
OS='linux-x86-64'
SED_DISABLE_BACKUP=""
fi
ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
if [ "$?" != "0" ]; then
echo 'Sources are not built'
./build.sh
fi
cd sonar-application/target/
ls sonarqube-*/bin/$OS/sonar.sh 1> /dev/null 2>&1
if [ "$?" != "0" ]; then
unzip sonarqube-*.zip
fi
cd sonarqube-*
if [ "$1" = "-d" ]; then
echo "enabling debug in conf/sonar.properties, listening on port 5005"
sed -i $SED_DISABLE_BACKUP '/javaAdditionalOpts/d' conf/sonar.properties
echo "" >> conf/sonar.properties
echo "sonar.web.javaAdditionalOpts=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" >> conf/sonar.properties
fi
bin/$OS/sonar.sh restart
sleep 1
tail -100f logs/sonar.log