Skip to content

Commit

Permalink
Change sonarqube version for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Topin2001 committed May 27, 2024
1 parent 72074a0 commit 84f373e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/java-continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: mvn -B clean package
- name: Test cnes-report
env:
SONARQUBE_VERSION: 9.9-community
SONARQUBE_VERSION: 10.5-community
run: |
version=$(cat pom.xml | grep "<version>.*</version>" | head -1 |awk -F'[><]' '{print $3}');
echo "Starting docker";
Expand All @@ -54,14 +54,13 @@ jobs:
docker restart sonarqube_${SONARQUBE_VERSION};
echo "Waiting up to 5 minutes for SonarQube...";
counter=0;
limit=500;
limit=300;
status_sonar=$(curl -s "http://localhost:9000/api/system/status" | grep "\"status\":\"UP\"" > /dev/null; echo $?);
while [[ 0 -ne $status_sonar && $counter -le $limit ]]; do
sleep 1;
counter=$(( $counter + 1 ));
status_sonar=$(curl -s "http://localhost:9000/api/system/status" | grep "\"status\":\"UP\"" > /dev/null; echo $?);
done;
echo "SQ logs : $(docker logs sonarqube_${SONARQUBE_VERSION})";
echo "SonarQube is $([[ 0 -eq $status_sonar ]] && echo "up" || echo "down"), after $counter tries";
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.organization=default-organization;
echo "Waiting for the SonarQube Compute Engine task to be completed...";
Expand Down

0 comments on commit 84f373e

Please sign in to comment.