Skip to content

Commit

Permalink
contrib/intel/jenkins: Add github build status updates throughout pip…
Browse files Browse the repository at this point in the history
…eline.

Let the Jenkinspipeline provide better updates about the current running
status of the build.

Signed-off-by: Zach Dworkin <zachary.dworkin@intel.com>
  • Loading branch information
zachdworkin committed Oct 11, 2024
1 parent 0360c42 commit 2b21460
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions contrib/intel/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@ properties([disableConcurrentBuilds(abortPrevious: true)])
@Field def PYTHON_VERSION="3.9"
@Field def TIMEOUT="7200"

def setBuildStatus(String message, String state) {
if (!env.CHANGE_URL.toBoolean()) {
echo "No change URL found. Skipping status update."
return
}
step([
$class: "GitHubCommitStatusSetter",
reposSource: [
$class: "ManuallyEnteredRepositorySource", url: env.CHANGE_URL
],
contextSource: [
$class: "ManuallyEnteredCommitContextSource",
context: "continuous-integration/intel/jenkins"
],
errorHandlers: [
[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]
],
statusResultSource: [
$class: "ConditionalStatusResultSource",
results: [[$class: "AnyBuildResult", message: message, state: state]]
]
]);
}

def run_python(version, command, output=null) {
if (output != null)
sh "python$version $command >> $output"
Expand Down Expand Up @@ -369,6 +393,7 @@ pipeline {
stage ('checkout') {
steps {
script {
setGitHubStatus("Pending", "PENDING")
dir ("${CUSTOM_WORKSPACE}/source/libfabric") {
checkout scm
}
Expand Down Expand Up @@ -438,6 +463,7 @@ pipeline {
stage ('build-ci') {
steps {
script {
setGitHubStatus("Building", "BUILDING")
build_ci()
}
}
Expand Down Expand Up @@ -559,6 +585,7 @@ pipeline {
stage ('CI_mpi_verbs-rxm_imb') {
steps {
script {
setGitHubStatus("Testing", "TESTING")
dir (CI_LOCATION) {
run_ci("CI_mpi_verbs-rxm_imb", "pr_imb_water.json")
}
Expand Down Expand Up @@ -900,6 +927,7 @@ pipeline {
when { equals expected: true, actual: DO_RUN }
steps {
script {
setGitHubStatus("Summarizing", "SUMMARIZING")
gather_logs("${env.DAOS_ADDR}", "${env.DAOS_KEY}", "${env.LOG_DIR}",
"${env.LOG_DIR}")
gather_logs("${env.ZE_ADDR}", "${env.ZE_KEY}", "${env.LOG_DIR}",
Expand Down Expand Up @@ -927,7 +955,15 @@ pipeline {
}
}
}
failure {
script {
setGitHubStatus("Build failed", "FAILED")
}
}
aborted {
script {
setGitHubStatus("Build aborted", "ABORTED")
}
node ('daos_head') {
dir ("${DELETE_LOCATION}/middlewares") { deleteDir() }
}
Expand All @@ -938,6 +974,7 @@ pipeline {
}
success {
script {
setGitHubStatus("Build succeeded", "SUCCESS")
if (DO_RUN) {
CI_summarize(verbose=true)
summarize("all", verbose=true, release=false,
Expand Down

0 comments on commit 2b21460

Please sign in to comment.