Compare commits

..

No commits in common. "442b5fbf0bafcbbd1f07215626be979c7cbf414d" and "3748117d59c879a783229078e4c762f0f235efc9" have entirely different histories.

View File

@ -212,19 +212,17 @@ pipeline {
'''
script {
// The Host header must match ALLOWED_HOSTS or Django answers
// 400 regardless of health. A 301 is the expected reply here:
// SECURE_SSL_REDIRECT sends plain HTTP to HTTPS, and reaching
// that redirect already proves the app processed the request.
// Confirm the application actually answers. A container that
// starts and immediately crashes would otherwise pass as a
// successful deployment.
def code = sh(returnStdout: true, script: '''
ssh ${SSH_OPTS} ${NAS_USER}@${NAS_HOST} \
"sleep 10 && curl -s -o /dev/null -w '%{http_code}' \
-H 'Host: finanzas.kuijper.es' \
http://127.0.0.1:8001/"
''').trim()
echo "Respuesta HTTP: ${code}"
if (!(code in ['200', '301', '302'])) {
if (!(code in ['200', '302'])) {
error("La aplicacion no responde correctamente (HTTP ${code})")
}
}