New try
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -50,12 +50,12 @@ pipeline {
|
||||
def buildDesc = currentBuild.currentResult == 'SUCCESS' ? 'Build successful' : 'Build failed'
|
||||
|
||||
// Notify Gitea using the API (requires credential in Jenkins)
|
||||
withCredentials([string(credentialsId: 'jenkins', variable: 'GITEA_TOKEN')]) {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: 'jenkins', variable: 'GITEA_TOKEN']]) {
|
||||
sh """
|
||||
curl -f -X POST "${GITEA_API_URL}/repos/${GITEA_REPO_PATH}/statuses/${commitSha}" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "${buildState}", "target_url": "${env.BUILD_URL}", "description": "${buildDesc}", "context": "jenkins-ci"}'
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "${buildState}", "target_url": "${env.BUILD_URL}", "description": "${buildDesc}", "context": "jenkins-ci"}'
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user