fix: wait gitea to be online before post request
All checks were successful
jenkins-ci Build successful
All checks were successful
jenkins-ci Build successful
This commit is contained in:
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@@ -43,6 +43,19 @@ pipeline {
|
|||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
script {
|
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..."
|
echo "Send Gitea check..."
|
||||||
// Get and store SHA
|
// Get and store SHA
|
||||||
def commitSha = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
|
def commitSha = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user