Skip to content
Snippets Groups Projects
Verified Commit 8b5232a9 authored by Fredrik Fonn Hansen's avatar Fredrik Fonn Hansen :8ball:
Browse files

ci enable periodic heartbeat

parent 6035c1ef
No related branches found
No related tags found
1 merge request!67ci enable periodic heartbeat
Pipeline #215697 passed with stages
in 2 minutes and 24 seconds
......@@ -121,15 +121,16 @@ VM Heartbeat:
- |
for i in {1..18}; do
sleep 10
response=$(curl --silent --write-out "%{http_code}\n" --output /dev/null --connect-timeout 5 --max-time 10 http://10.212.26.72/server/heartbeat)
echo "Response: $response"
if [ "$response" -eq 200 ]; then
echo "Server is alive"
response_code=$(curl --silent --write-out "%{http_code}\n" --output response.txt --connect-timeout 5 --max-time 10 http://10.212.26.72/server/heartbeat)
response_body=$(cat response.txt)
echo "Response code: $response_code"
echo "Response body: $response_body"
if [ "$response_code" -eq 200 ]; then
exit 0
fi
done
echo "Server did not respond with 200 OK after 3 minutes"
exit 1
only:
refs:
- main
\ No newline at end of file
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_PIPELINE_SOURCE == "schedule" && $RUN_VM_HEARTBEAT == "true"'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment