From 72074a0b05af896128721a6f552a0fc9d601975a Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Mon, 27 May 2024 12:10:48 +0200 Subject: [PATCH] Added time for SQ start and print of logs --- .github/workflows/java-continuous-integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-continuous-integration.yml b/.github/workflows/java-continuous-integration.yml index ee3ca272..04f02498 100644 --- a/.github/workflows/java-continuous-integration.yml +++ b/.github/workflows/java-continuous-integration.yml @@ -54,13 +54,14 @@ jobs: docker restart sonarqube_${SONARQUBE_VERSION}; echo "Waiting up to 5 minutes for SonarQube..."; counter=0; - limit=300; + limit=500; 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...";