Add Gitea commit status reporting
continuous-integration/jenkins Build passed
continuous-integration/jenkins Build passed
This commit is contained in:
Vendored
+30
@@ -16,4 +16,34 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'gitea-token',
|
||||
usernameVariable: 'GITEA_USER',
|
||||
passwordVariable: 'GITEA_TOKEN')]) {
|
||||
sh '''
|
||||
curl -s -X POST \
|
||||
"https://git.ssw590.abrdns.com/api/v1/repos/StartupTeam/Strartup-product/statuses/${GIT_COMMIT}" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state":"success","context":"continuous-integration/jenkins","description":"Build passed"}'
|
||||
'''
|
||||
}
|
||||
}
|
||||
failure {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'gitea-token',
|
||||
usernameVariable: 'GITEA_USER',
|
||||
passwordVariable: 'GITEA_TOKEN')]) {
|
||||
sh '''
|
||||
curl -s -X POST \
|
||||
"https://git.ssw590.abrdns.com/api/v1/repos/StartupTeam/Strartup-product/statuses/${GIT_COMMIT}" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state":"failure","context":"continuous-integration/jenkins","description":"Build failed"}'
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user