fix: wait gitea to be online before post request
All checks were successful
jenkins-ci Build successful

This commit is contained in:
2026-01-26 12:43:46 +00:00
parent 488cd8eef4
commit 7840de0a44

13
Jenkinsfile vendored
View File

@@ -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()