From 11d2408289e97be7dae163a59ad3a5a29e4a3946 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Sat, 26 Sep 2020 21:41:12 +0000 Subject: [PATCH] jenkins: try and set commit status on correct commit Logs on jenkins showed it trying to set the commit state on the wrong commits, the master of upstream, instead of the head of the PR --- tests/gadget-zero/Jenkinsfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/gadget-zero/Jenkinsfile b/tests/gadget-zero/Jenkinsfile index 49a5fa36..d804bd00 100644 --- a/tests/gadget-zero/Jenkinsfile +++ b/tests/gadget-zero/Jenkinsfile @@ -9,9 +9,15 @@ pipeline { stages { stage('checkout') { steps { - sh "echo karl we are building $pr_from_sha" - checkout([$class: 'GitSCM', branches: [[name: "$pr_from_sha"]], userRemoteConfigs: [[url: "$pr_from_git_url"]]]) - step([$class: 'GitHubSetCommitStatusBuilder']) + sh "echo karl we are building $pr_from_sha" + checkout([$class: 'GitSCM', branches: [[name: "$pr_from_sha"]], userRemoteConfigs: [[url: "$pr_from_git_url"]]]) + step([ + class: "GitHubCommitStatusSetter", + commitShaSource: [$class: "ManuallyEnteredShaSource", sha: "$pr_from_sha"], + reposSource: [$class: "ManuallyEnteredRepositorySource", url: "$pr_from_git_url"], + contextSource: [$class: "DefaultCommitContextSource"], + statusResultSource: [ $class: "DefaultStatusResultSource"] + ]); } } stage('prepare') {