Skip to content

Commit

Permalink
remove status functions
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherdjerred committed Feb 17, 2024
1 parent 0614c7f commit bff153f
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@

def getRepoURL() {
sh "mkdir -p .git"
sh "git config --get remote.origin.url > .git/remote-url"
return readFile(".git/remote-url").trim()
}
def getCommitSha() {
sh "mkdir -p .git"
sh "git rev-parse HEAD > .git/current-commit"
return readFile(".git/current-commit").trim()
}

def updateGithubCommitStatus(build, String context, String buildUrl, String message, String state) {
// workaround https://issues.jenkins-ci.org/browse/JENKINS-38674
repoUrl = getRepoURL()
commitSha = getCommitSha()
println "Updating Github Commit Status"
println "repoUrl $repoUrl"
println "commitSha $commitSha"
println "build result: ${build.result}, currentResult: ${build.currentResult}"

step([
$class: 'GitHubCommitStatusSetter',
reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl],
commitShaSource: [$class: "ManuallyEnteredShaSource", sha: commitSha],
errorHandlers: [[$class: 'ShallowAnyErrorHandler']],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: context],
statusBackrefSource: [$class: "ManuallyEnteredBackrefSource", backref: buildUrl],

statusResultSource: [
$class: 'ConditionalStatusResultSource',
results: [
[$class: 'AnyBuildResult', state: state, message: message]
]
]
])
}

pipeline {
agent {
kubernetes {
Expand Down

0 comments on commit bff153f

Please sign in to comment.