From 858c5c2e3e4fcd75d529c60df1fbcbeaff0395dc Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 7 Nov 2018 12:03:57 -0500 Subject: Better test for version pins file. Rename example pins file to prevent unintentional use. --- jenkins/dispatch.groovy | 18 +++++++----------- jenkins/version_pins.yml | 16 ---------------- jenkins/version_pins.yml.example | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 jenkins/version_pins.yml create mode 100644 jenkins/version_pins.yml.example diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 83635fb..558ef05 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -104,7 +104,12 @@ node(LABEL) { writeFile file: MANIFEST_FILE, text: manifest_data, encoding: "UTF-8" } - this.pins_file = readYaml file: "jenkins/${this.version_pins_file}" + // Check for existence of version pins file. + this.use_version_pins = 'false' + if (fileExists("jenkins/${this.version_pins_file}")) { + this.pins_file = readYaml file: "jenkins/${this.version_pins_file}" + this.use_version_pins = 'true' + } // Allow for sharing build_list between stages below. this.build_list = [] @@ -239,21 +244,12 @@ node(LABEL) { sh "patch ${filename} ${full_patchname}" } - // Determine if version_pins_file has a list of packages to pin. - try { - this.pins_file.packages - this.use_version_pins = "true" - } catch(MissingPropertyException) { - println("${this.version_pins_file} has no packages list, skipping pin environment creation.") - this.use_version_pins = "false" - } - // (conda-build 3.x only) // Create and populate environment to be used for pinning reference when // building packages via the --bootstrap flag. Environment creation is done // using the explicit packages and versions in the pin file, with no // dependencies. - if (CONDA_BUILD_VERSION[0] == "3" && this.use_version_pins == "true") { + if (CONDA_BUILD_VERSION[0] == "3" && this.use_version_pins == 'true') { println("Creating environment based on package pin values found \n" + "in ${this.version_pins_file} to use as global version pinnning \n" + "specification. Packages to be installed in pin environment:") diff --git a/jenkins/version_pins.yml b/jenkins/version_pins.yml deleted file mode 100644 index 2d6f23e..0000000 --- a/jenkins/version_pins.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file must exist even if empty or entirely commented out. -# -# This file is only honored when the build system is configured to use -# conda-build 3.x. -# -# It allows the definition of a list of core dependency packages to pin to -# the supplied values when building packages from a manifest in a job suite. -# -# Example use case: -# - setuptools 36.4.0 is released in a broken state which prevents packages -# that have it as a build requirement from building. -# - setuptools can be pinned to an earlier version for all package builds -# that happen in a given job suite, allowing them to succeed. -# -#packages: -# - setuptools 27.2.0 diff --git a/jenkins/version_pins.yml.example b/jenkins/version_pins.yml.example new file mode 100644 index 0000000..2d6f23e --- /dev/null +++ b/jenkins/version_pins.yml.example @@ -0,0 +1,16 @@ +# This file must exist even if empty or entirely commented out. +# +# This file is only honored when the build system is configured to use +# conda-build 3.x. +# +# It allows the definition of a list of core dependency packages to pin to +# the supplied values when building packages from a manifest in a job suite. +# +# Example use case: +# - setuptools 36.4.0 is released in a broken state which prevents packages +# that have it as a build requirement from building. +# - setuptools can be pinned to an earlier version for all package builds +# that happen in a given job suite, allowing them to succeed. +# +#packages: +# - setuptools 27.2.0 -- cgit