Commit 112b8d49 authored by Bùi Bá Trường's avatar Bùi Bá Trường

truongbb - test ci

parent c248b29b
Pipeline #377 passed with stages
in 22 seconds
...@@ -46,32 +46,16 @@ sub_sonar-scan(){ ...@@ -46,32 +46,16 @@ sub_sonar-scan(){
} }
sub_quality-gate(){ sub_quality-gate(){
qualityGateStatus=$(curl --request POST \
# curl -s -w "\n%{http_code}" 'http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci' | {
# echo "1111111111111111111111"
# read body
# read code
# echo ${code}
# jq .name <<< "$body"
# }
# response=$(curl -s -w "\n%{http_code}" 'http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci')
# response=(${response[@]}) # convert to array
# code=${response[-1]} # get last element (last line)
# body=${response[@]::${#response[@]}-1} # get all elements except last
# bodyRes=$(echo $body | jq '.bodyRes')
# echo $code
# echo "body: "$bodyRes
# res=$( curl --request POST \
# --url http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci \
# --header 'cache-control: no-cache' --header 'content-type: application/json' | jq '.res')
# echo "${res}"
content=$(curl --request POST \
--url http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci \ --url http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci \
--header 'cache-control: no-cache' --header 'content-type: application/json' | jq -r '.projectStatus.status') --header 'cache-control: no-cache' --header 'content-type: application/json' | jq -r '.projectStatus.status')
echo "body: " ${content} echo "Quality gate status: " ${qualityGateStatus}
if [${qualityGateStatus} == "OK"]
then
echo "OK"
else
echo "NOK"
fi
} }
sub_send-email(){ sub_send-email(){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment