mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 07:45:49 +00:00
jenkins9
This commit is contained in:
parent
e27f25af28
commit
35f8656f0e
1 changed files with 7 additions and 10 deletions
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
|
@ -1,12 +1,5 @@
|
||||||
void setBuildStatus(String message, String state) {
|
String buildUrl = "${BUILD_URL}"
|
||||||
step([
|
String gitStatusPostUrl = "https://<Github Personal Access Token>:x-oauth-basic@api.github.com/repos/<owner>/<repo>/statuses/${gitHash}"
|
||||||
$class: "GitHubCommitStatusSetter",
|
|
||||||
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/Firassawan/spring-petclinic"],
|
|
||||||
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
|
|
||||||
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
|
|
||||||
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
@ -49,3 +42,7 @@ pipeline {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sh """
|
||||||
|
curl -X POST -H "application/json" -d '{"state":"success", "target_url":"${buildUrl}", "description":"Build Success", "context":"build/job"}' "${gitStatusPostUrl}"
|
||||||
|
"""
|
Loading…
Reference in a new issue