fixes
This commit is contained in:
@@ -32,16 +32,19 @@ pre_push:
|
|||||||
- apk add curl
|
- apk add curl
|
||||||
script:
|
script:
|
||||||
- echo "Running container to test image"
|
- echo "Running container to test image"
|
||||||
- docker run -d --name test_container -p 17000:5050 $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG
|
- docker run -d --rm --name test_container $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG
|
||||||
|
- CONTAINER_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' test_container)
|
||||||
- |
|
- |
|
||||||
echo "Waiting for the application to start..."
|
echo "Waiting for the application to start..."
|
||||||
sleep 10
|
sleep 10
|
||||||
if curl --fail http://localhost:17000/health; then
|
if curl --fail http://$CONTAINER_IP:5050/health; then
|
||||||
echo "Healthcheck passed"
|
echo "Healthcheck passed"
|
||||||
else
|
else
|
||||||
echo "Healthcheck failed, stopping push"
|
echo "Healthcheck failed, stopping push"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- docker rm -f test_container
|
- docker rm -f test_container
|
||||||
only:
|
only:
|
||||||
|
|||||||
Reference in New Issue
Block a user