diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index d49bf50..ade7c49 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -114,16 +114,26 @@ jobs: exit 1 runAnalysisTest: runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + volumes: + - sonarqube_data:/tmp/sonarqube_data + - sonarqube_logs:/tmp/sonarqube_logs + - sonarqube_extensions:/tmp/sonarqube_extensions services: sonarqube: image: sonarqube:lts-community ports: - 9000:9000 - options: >- - --health-cmd "curl --fail --user admin:admin http://127.0.0.1:9000/api/system/status || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 1000 + volumes: + - sonarqube_data:/opt/sonarqube/data + - sonarqube_logs:/opt/sonarqube/logs + - sonarqube_extensions:/opt/sonarqube/extensions +# options: >- +# --health-cmd "curl --fail --user admin:admin http://127.0.0.1:9000/api/system/status" +# --health-interval 10s +# --health-timeout 5s +# --health-retries 10 steps: - uses: actions/checkout@v4 with: diff --git a/test/waitForSonarQubeUp.sh b/test/waitForSonarQubeUp.sh index 8ba486b..5b9a344 100755 --- a/test/waitForSonarQubeUp.sh +++ b/test/waitForSonarQubeUp.sh @@ -7,7 +7,7 @@ success() { echo -e "\\e[32m✔ $*\\e[0m"; } # Helper function to check if SonarQube is up and running. check_sq_is_up() { - local statusCall="$(curl --silent --user admin:admin http://127.0.0.1:9000/api/system/status)" + local statusCall="$(curl --silent --user admin:admin http://sonarqube:9000/api/system/status)" local status="$(jq -r '.status' <<< "$statusCall")" if [[ ! $? -eq 0 ]]; then error "Failed to check if SonarQube is up and running." @@ -20,9 +20,6 @@ info "Wait until SonarQube is up..." sleep 5 isUp=$(check_sq_is_up) until [[ "$isUp" == "UP" ]]; do - echo $isUp - ls ./sonarqube_data - cat ./sonarqube_data/logs/sonar.log sleep 1 isUp=$(check_sq_is_up) done