mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +00:00
jenkins9
This commit is contained in:
parent
e27f25af28
commit
35f8656f0e
1 changed files with 7 additions and 10 deletions
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
|
@ -1,12 +1,5 @@
|
|||
void setBuildStatus(String message, String state) {
|
||||
step([
|
||||
$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]] ]
|
||||
]);
|
||||
}
|
||||
String buildUrl = "${BUILD_URL}"
|
||||
String gitStatusPostUrl = "https://<Github Personal Access Token>:x-oauth-basic@api.github.com/repos/<owner>/<repo>/statuses/${gitHash}"
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
@ -48,4 +41,8 @@ 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