summaryrefslogtreecommitdiffstats
path: root/run.sh
blob: 6ea64a19f02e943ca4711bef7fea4c5eee6e3f85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [[ "$OSTYPE" == "darwin"* ]]; then
  OS='macosx-universal-64'
else
  OS='linux-x86-64'
fi

if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
  echo 'Sources are not built'
  ./build.sh
fi

cd sonar-application/target/
if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
  unzip sonarqube-*.zip
fi
cd sonarqube-*
bin/$OS/sonar.sh restart
echo "sonar.search.http.port=9200" >>  conf/sonar.properties
sleep 1
tail -100f logs/sonar.log