Skip to content
Snippets Groups Projects
Commit 605331c5 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

get http code, show log only on issue

parent d14ddf10
No related branches found
No related tags found
1 merge request!27test images
Pipeline #133475 failed
Pipeline: shiny-k8s-example

#133477

    ......@@ -82,8 +82,15 @@ variables:
    - echo "Now Testing"
    - apk add --no-cache curl
    - docker run --name ${MD5SUM} -d -u 999 -p 0.0.0.0:3838:3838 $IMAGE_PATH
    - curl --retry-all-errors --retry 10 --retry-delay 1 -s -o /dev/null 0.0.0.0:3838
    - docker logs ${MD5SUM}
    - HTTP_CODE=$(curl --retry-all-errors --retry 10 --retry-delay 1 -w "%{http_code}" -s -o /dev/null 0.0.0.0:3838)
    - |
    if [ ${HTTP_CODE} == "200" ]; then
    echo "HTTP_CODE is 200, good."
    else
    echo "HTTP_CODE is ${HTTP_CODE}, which is a bad news, here are the logs:"
    docker logs ${MD5SUM}
    exit 2
    fi
    artifacts:
    when: always
    paths:
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment