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
This commit is contained in:
Karl Palsson 2020-09-26 21:41:12 +00:00
parent 52dc1ff6d7
commit 11d2408289

View File

@ -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') {