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'
|
def buildDesc = currentBuild.currentResult == 'SUCCESS' ? 'Build successful' : 'Build failed'
|
||||||
|
|
||||||
// Notify Gitea using the API (requires credential in Jenkins)
|
// 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 """
|
sh """
|
||||||
curl -f -X POST "${GITEA_API_URL}/repos/${GITEA_REPO_PATH}/statuses/${commitSha}" \
|
curl -f -X POST "${GITEA_API_URL}/repos/${GITEA_REPO_PATH}/statuses/${commitSha}" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"state": "${buildState}", "target_url": "${env.BUILD_URL}", "description": "${buildDesc}", "context": "jenkins-ci"}'
|
-d '{"state": "${buildState}", "target_url": "${env.BUILD_URL}", "description": "${buildDesc}", "context": "jenkins-ci"}'
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user