-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute.sh
More file actions
32 lines (28 loc) · 1.21 KB
/
execute.sh
File metadata and controls
32 lines (28 loc) · 1.21 KB
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
#!/bin/bash
#download sonar-runner
curl -o sonar-runner-dist-2.4.zip -fSL http://repo1.maven.org/maven2/org/codehaus/sonar/runner/sonar-runner-dist/2.4/sonar-runner-dist-2.4.zip
unzip sonar-runner-dist-2.4.zip
#update sonar-runner.properties
rm sonar-runner-2.4/conf/sonar-runner.properties
echo "#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://${IP_ADDR}:9000
#temp DB
sonar.jdbc.url=jdbc:h2:tcp://${IP_ADDR}/sonar
#----- PostgreSQL
#sonar.jdbc.url=jdbc:postgresql://134.168.19.103/sonar
#----- Global database settings
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar" > sonar-runner-2.4/conf/sonar-runner.properties
#test
#if choices are empty
if [ -z "$SRC" ] && [ -z "$KEY" ]; then
#assume .properties file is present and execute
sonar-runner-2.4/bin/sonar-runner
fi
if [ ! -f sonar-project.properties ]; then
#no configuration so use provided info to run
proj_name="${IDS_PROJECT_NAME//|}"
sonar-runner-2.4/bin/sonar-runner -Dsonar.projectKey=${KEY} -Dsonar.projectName=${proj_name// /_} -Dsonar.projectVersion=1.0 -Dsonar.sources=${SRC}
fi