-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* provide compose.yaml that (pulls) and runs sonarQube in persistent mode with pg * setup of sonar server and gradle build for scanning and test coverage woth jacoco. * remove java plugin from root Build_gradle * fix bootstrap issue on other OS with elastic
- Loading branch information
1 parent
83ca801
commit 337bc2f
Showing
11 changed files
with
121 additions
and
9 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo -e "\n*** setting up SonarQube locally for flashcards project ***\n" | ||
docker-compose -f sonar/docker-compose.yaml up -d | ||
|
||
# Wait for SonarQube to be up and running | ||
echo -e "\n*** waiting for SonarQube to start ***\n" | ||
until curl --silent http://localhost:9000/api/system/status | grep "UP" ; do | ||
printf '.' | ||
sleep 5 # wait 5 seconds before check again | ||
done | ||
|
||
echo -e "\n*** SonarQube is up. Creating flashcards-server project via WebAPI ***\n" | ||
echo "Enter SonarQube Admin password: " && read password | ||
curl -X POST "http://localhost:9000/api/projects/create?name=Flashcards%20Server&project=flashcards-server" -u "admin:$password" | ||
echo | ||
response=$(curl -s -X POST -u "admin:$password" "http://localhost:9000/api/user_tokens/generate?name=flashcardsToken&projectKey=flashcards-server&type=PROJECT_ANALYSIS_TOKEN") | ||
token=$(echo $response | grep -o '"token":"[^"]*' | cut -d'"' -f4) | ||
echo -e "\nGenerated project token:\nsonarToken=$token" | ||
echo "**** copy above line (sonarToken=...) to the gradle.properties file in the root of the project" | ||
echo "it will be used by the sonarqube gradle plugin to upload the results of the analysis to the server" | ||
echo -e "It is on .gitignore so it will not be committed to the repository.\n" | ||
|
||
echo -e "Now go to http://localhost:9000/projects/flashcards-server and have fun!\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ out/ | |
.idea/modules/ | ||
.idea/*.xml | ||
compose.yaml | ||
gradle.properties | ||
|
||
### Mac OS ### | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: "3" | ||
services: | ||
sonarqube: | ||
image: sonarqube:community | ||
hostname: sonarqube | ||
container_name: sonarqube | ||
depends_on: | ||
- db | ||
environment: | ||
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar | ||
SONAR_JDBC_USERNAME: sonar | ||
SONAR_JDBC_PASSWORD: sonar | ||
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: "true" | ||
volumes: | ||
- sonarqube_data:/opt/sonarqube/data | ||
- sonarqube_extensions:/opt/sonarqube/extensions | ||
- sonarqube_logs:/opt/sonarqube/logs | ||
ports: | ||
- "9000:9000" | ||
db: | ||
image: postgres:alpine | ||
hostname: postgresql | ||
container_name: postgres-sonar | ||
environment: | ||
POSTGRES_USER: sonar | ||
POSTGRES_PASSWORD: sonar | ||
POSTGRES_DB: sonar | ||
volumes: | ||
- postgresql:/var/lib/postgresql | ||
- postgresql_data:/var/lib/postgresql/data | ||
|
||
volumes: | ||
sonarqube_data: | ||
sonarqube_extensions: | ||
sonarqube_logs: | ||
postgresql: | ||
postgresql_data: |