Add Gitea commit status reporting
continuous-integration/jenkins Build passed

This commit is contained in:
2026-10-02 20:30:08 +00:00
parent 023ea11be0
commit 362c43b28d
Vendored
+30
View File
@@ -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"}'
'''
}
}
}
}