2015-04-03 11:05:37 +02:00
|
|
|
#!/bin/bash
|
2015-04-14 09:43:47 +02:00
|
|
|
###############################
|
|
|
|
# usage: use -d option to enable remote debugging of the web server on port 5005
|
|
|
|
###############################
|
2011-04-19 17:36:14 +02:00
|
|
|
|
2014-05-05 14:21:26 +02:00
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
|
OS='macosx-universal-64'
|
2015-04-14 09:43:47 +02:00
|
|
|
SED_DISABLE_BACKUP=" ''"
|
2014-05-05 14:21:26 +02:00
|
|
|
else
|
|
|
|
OS='linux-x86-64'
|
2015-04-14 09:43:47 +02:00
|
|
|
SED_DISABLE_BACKUP=""
|
2014-05-05 14:21:26 +02:00
|
|
|
fi
|
|
|
|
|
2015-04-03 11:05:37 +02:00
|
|
|
ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
|
|
|
|
if [ "$?" != "0" ]; then
|
2014-05-05 13:04:17 +02:00
|
|
|
echo 'Sources are not built'
|
2014-05-05 14:21:26 +02:00
|
|
|
./build.sh
|
2014-05-05 13:04:17 +02:00
|
|
|
fi
|
2014-05-01 21:07:36 +02:00
|
|
|
|
2010-09-06 16:08:06 +02:00
|
|
|
cd sonar-application/target/
|
2015-04-03 11:05:37 +02:00
|
|
|
ls sonarqube-*/bin/$OS/sonar.sh 1> /dev/null 2>&1
|
|
|
|
if [ "$?" != "0" ]; then
|
2014-05-05 13:04:17 +02:00
|
|
|
unzip sonarqube-*.zip
|
|
|
|
fi
|
2014-05-05 10:08:28 +02:00
|
|
|
cd sonarqube-*
|
2015-04-14 09:43:47 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2014-05-05 14:21:26 +02:00
|
|
|
bin/$OS/sonar.sh restart
|
2014-05-05 09:23:22 +02:00
|
|
|
sleep 1
|
|
|
|
tail -100f logs/sonar.log
|