This commit is contained in:
Firas Sawan 2020-03-09 21:41:51 -04:00
parent e27f25af28
commit 35f8656f0e

15
Jenkinsfile vendored
View file

@ -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}"
"""