File tree Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ source scripts/requireCommand.sh
4
+
5
+ requireCommand curl
6
+ requireCommand jq
7
+
3
8
# Check for install/updates at https://github.com/SonarSource/sonarqube
4
9
5
- sonar_host=" http://localhost:9000"
6
- sonar_project=" benchmark"
7
- sonar_token=" 291e50b66b5f5198e6ac0d49bf1057ac3a3a0fc8"
10
+ if [ ! -f scripts/SonarQubeCredentials.sh ]; then
11
+ cat > scripts/SonarQubeCredentials.sh << EOF
12
+ #!/usr/bin/env bash
13
+
14
+ sonar_host="" # e. g. http://localhost:9000
15
+ sonar_project=""
16
+ sonar_token=""
17
+ EOF
18
+ chmod +x scripts/SonarQubeCredentials.sh
19
+ fi
20
+
21
+ source scripts/SonarQubeCredentials.sh
22
+
23
+ if [ -z " $sonar_host " ] || [ -z " $sonar_project " ] || [ -z " $sonar_token " ]; then
24
+ echo " Please provide credentials in SonarQubeCredentials.sh"
25
+ exit 1
26
+ fi
8
27
9
- mvn sonar:sonar \
10
- -Dsonar.projectKey=" $sonar_project " \
11
- -Dsonar.host.url=" $sonar_host " \
12
- -Dsonar.login=" $sonar_token "
28
+ mvn sonar:sonar -Dsonar.projectKey=" $sonar_project " -Dsonar.host.url=" $sonar_host " -Dsonar.login=" $sonar_token "
13
29
14
30
sleep 300s # might be replaced with polling of $sonar_host/api/ce/component?component=$sonar_project
15
31
You can’t perform that action at this time.
0 commit comments