diff --git a/Jenkinsfile b/Jenkinsfile index e5fc1df..7d681b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -178,6 +178,28 @@ PY ''' } } + stage('Wait For Staging Health') { + agent { label 'built-in' } + options { + timeout(time: 5, unit: 'MINUTES') + } + steps { + sh ''' + set -e + for i in $(seq 1 30); do + code_nl=$(curl -sS -o /dev/null -w "%{http_code}" https://mandelstudio.welkombij.mandelblog.com/ || true) + code_en=$(curl -sS -o /dev/null -w "%{http_code}" https://mandelstudio.welkombij.mandelblog.com/en/ || true) + echo "healthcheck attempt=$i nl=$code_nl en=$code_en" + if [ "$code_nl" = "200" ] && [ "$code_en" = "200" ]; then + exit 0 + fi + sleep 10 + done + echo "staging did not become healthy in time" + exit 1 + ''' + } + } stage('Post-Deploy Multilingual Audit') { agent { label 'built-in' } options {