fixup! SONAR-14822 Write an IT

This commit is contained in:
Wouter Admiraal 2021-05-14 15:09:06 +02:00
parent 74b52a8d2b
commit 8f53ecd1ff

View file

@ -7,13 +7,13 @@ success() { echo -e "\\e[32m✔ $*\\e[0m"; }
# Helper function to check if SonarQube is up and running. # Helper function to check if SonarQube is up and running.
check_sq_is_up() { check_sq_is_up() {
local status="$(curl --silent --user admin:admin http://127.0.0.1:9000/api/system/status)" local statusCall="$(curl --silent --user admin:admin http://127.0.0.1:9000/api/system/status)"
local result="$(jq -r '.status' <<< "$status")" local status="$(jq -r '.status' <<< "$statusCall")"
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
error "Failed to check if SonarQube is up and running." error "Failed to check if SonarQube is up and running."
exit 1 exit 1
fi fi
echo $result; echo $status;
} }
info "Build scanner action..." info "Build scanner action..."
@ -56,9 +56,7 @@ docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $ne
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
error "Couldn't run the analysis." error "Couldn't run the analysis."
exit 1 exit 1
fi elif [[ ! -f ".scannerwork/report-task.txt" ]]; then
if [[ ! -f ".scannerwork/report-task.txt" ]]; then
error "Couldn't find the report task file. Analysis failed." error "Couldn't find the report task file. Analysis failed."
exit 1 exit 1
fi fi