diff --git a/Jenkinsfile b/Jenkinsfile index 034c0d6..bc2c1de 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,6 +43,19 @@ pipeline { post { always { script { + echo "Waiting for Gitea to be online..." + + // Try to reac gitea API for 12 tries of 10s (2 minutes) + timeout(time: 2, unit: 'MINUTES') { + waitUntil { + def status = sh( + script: "curl -s -o /dev/null -w '%{http_code}' ${GITEA_API_URL}/version || true", + returnStdout: true + ).trim() + return (status == '200') + } + } + echo "Send Gitea check..." // Get and store SHA def commitSha = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()