From 35f8656f0ef31854e8933e0c6ba1faa647f9d384 Mon Sep 17 00:00:00 2001 From: Firas Sawan Date: Mon, 9 Mar 2020 21:41:51 -0400 Subject: [PATCH] jenkins9 --- Jenkinsfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5bd6840e4..fe9a476e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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://:x-oauth-basic@api.github.com/repos///statuses/${gitHash}" pipeline { agent any @@ -48,4 +41,8 @@ pipeline { } } -} \ No newline at end of file +} + +sh """ +curl -X POST -H "application/json" -d '{"state":"success", "target_url":"${buildUrl}", "description":"Build Success", "context":"build/job"}' "${gitStatusPostUrl}" +""" \ No newline at end of file