changed health check command so it works on jenkins + k8s

This commit is contained in:
Vinay Aggarwal
2020-03-26 16:40:51 -07:00
parent 0b633a6b4c
commit 371c2b9fe4

View File

@@ -62,12 +62,12 @@ do
SUCCESS=false SUCCESS=false
for i in {1..30} for i in {1..30}
do do
STATUS=$(curl -u admin:$ARTIFACTORY_PASSWORD http://localhost:8082/router/api/v1/system/health | jq .services[0].state) STATUS=$(docker exec -it test-new-image curl -u admin:$ARTIFACTORY_PASSWORD http://localhost:8082/router/api/v1/system/health | jq .services[0].state)
if [ "$STATUS" == "\"HEALTHY\"" ]; then if [ "$STATUS" == "\"HEALTHY\"" ]; then
echo "Build successful!" echo "Build successful!"
SUCCESS=true SUCCESS=true
break break
fi fi
echo "Container is not up yet, waiting 10 seconds..." echo "Container is not up yet, waiting 10 seconds..."
sleep 10 sleep 10
done done