mirror of
https://github.com/ClusterCockpit/cc-docker.git
synced 2024-11-10 09:07:25 +01:00
add accessTest script to workflow
This commit is contained in:
parent
908c281a47
commit
23276293df
37
.github/accessTest.sh
vendored
Executable file
37
.github/accessTest.sh
vendored
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
x=1
|
||||||
|
attempts=6
|
||||||
|
|
||||||
|
while [ $x -le $attempts ]
|
||||||
|
do
|
||||||
|
echo "Attempt $x to connect to localhost:80/login"
|
||||||
|
CODE=$( curl -X GET localhost:80/login --write-out '%{http_code}' --silent --output /dev/null )
|
||||||
|
echo "Result HTML Code: $CODE"
|
||||||
|
|
||||||
|
if [ $CODE -eq '200' ]
|
||||||
|
then
|
||||||
|
echo "... Success!"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "... No response!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $x -lt $attempts ]
|
||||||
|
then
|
||||||
|
echo "Retrying in 10 seconds."
|
||||||
|
sleep 10s
|
||||||
|
x=$(( $x + 1 ))
|
||||||
|
else
|
||||||
|
echo "Could not get response 200 from localhost:80/login !"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $x -lt $attempts ]
|
||||||
|
then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 110
|
||||||
|
fi
|
8
.github/workflows/ccdocker_demo_startup.yml
vendored
8
.github/workflows/ccdocker_demo_startup.yml
vendored
@ -41,12 +41,14 @@ jobs:
|
|||||||
- name: Get log from cc-db
|
- name: Get log from cc-db
|
||||||
run: docker logs cc-db
|
run: docker logs cc-db
|
||||||
|
|
||||||
|
- name: Attempt to curl localhost:80/login
|
||||||
|
run: |
|
||||||
|
chmod +x ./.github/accessTest.sh
|
||||||
|
./.github/accessTest.sh
|
||||||
|
|
||||||
- name: Get log from cc-php
|
- name: Get log from cc-php
|
||||||
run: docker logs cc-php
|
run: docker logs cc-php
|
||||||
|
|
||||||
- name: Try to get response from localhost:90/login
|
|
||||||
run: curl -X GET localhost:80/login
|
|
||||||
|
|
||||||
- name: Stop containers
|
- name: Stop containers
|
||||||
if: always()
|
if: always()
|
||||||
run: docker-compose -f "docker-compose.yml" down
|
run: docker-compose -f "docker-compose.yml" down
|
||||||
|
Loading…
Reference in New Issue
Block a user