Skip to content

Commit

Permalink
SQ startup
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed May 15, 2024
1 parent 1726e88 commit 9bee1e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions test/waitForSonarQubeUp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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
Expand Down

0 comments on commit 9bee1e9

Please sign in to comment.