From 277175ed0d5bedc87e18a41de8b2e44a5636d62e Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 7 Jun 2017 14:42:27 -0400 Subject: Setup for build status propagation to dispatch job --- jenkins/package_builder.groovy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'jenkins/package_builder.groovy') diff --git a/jenkins/package_builder.groovy b/jenkins/package_builder.groovy index 37812ec..be868b0 100644 --- a/jenkins/package_builder.groovy +++ b/jenkins/package_builder.groovy @@ -1,3 +1,5 @@ +this.build_status_file = "${this.parent_workspace}/propagated_build_status" + node(this.label) { dir(this.parent_workspace) { @@ -28,6 +30,8 @@ node(this.label) { "PYTHONPATH: ${env.PYTHONPATH}\n" + "PYTHONUNBUFFERED: ${env.PYTHONUNBUFFERED}\n") + def build_status = readFile this.build_status_file + // In the directory common to all package build jobs, // run conda build --dirty for this package to use any existing work // directory or source trees already obtained. @@ -63,6 +67,11 @@ node(this.label) { returnStatus: true) if (stat != 0) { currentBuild.result = "FAILURE" + // Check if build status file already contains failure + // status. If not, write failure status to the file. + if (build_status != "FAILURE") { + sh "echo FAILURE > ${this.build_status_file}" + } } } @@ -79,6 +88,11 @@ node(this.label) { returnStatus: true) if (stat != 0) { currentBuild.result = "UNSTABLE" + // Check if build status file already contains unstable + // status. If not, write unstable status to the file. + if (build_status != "FAILURE") { + sh "echo FAILURE > ${this.build_status_file}" + } } } -- cgit