diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2018-01-05 13:41:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-05 13:41:32 -0500 |
commit | 80eaa72ce0b550bcc9a0bbfb29e790719083e906 (patch) | |
tree | 73eb034762f0b4214a1d4265aa469faeec39f6cf /jenkins | |
parent | 2b1d676011a0329fbdfa29e8c8363ab0701a93c0 (diff) | |
parent | 6806ffa9329b309c15488c795784ae4687f1a482 (diff) | |
download | build_control-80eaa72ce0b550bcc9a0bbfb29e790719083e906.tar.gz |
Merge pull request #50 from rendinam/specfile_gen1.0.15
Allow for JWST specfile generation
Diffstat (limited to 'jenkins')
-rw-r--r-- | jenkins/dispatch.groovy | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index a79635e..e45b236 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -267,7 +267,7 @@ node(LABEL) { // Generate a filtered, optionally culled, & dependency-ordered list // of available package recipes. def culled_option = "" - if (this.cull_manifest) { + if (this.cull_manifest == "true") { culled_option = "--culled" } def build_list_file = "build_list" @@ -356,6 +356,50 @@ node(LABEL) { } } + // If spec file generation was requested at trigger time, generate one. + // Create a conda environment containing all packages specified in the manifest. + specfile_type = "" + try { + specfile_type = this.manifest.specfile_type + } catch(all) { + println("specfile_type not found in manifest. Not creating spec file.") + } + + specfile_output = "" + try { + specfile_output = this.manifest.specfile_output + } catch(all) { + println("specfile_output not found in manifest. Not creating spec file.") + // prepare to skip specfile_creation + specfile_type = "NONE" + } + + if (specfile_type == "jwstdp") { + stage("Create spec file") { + // If an 'ASCO_GIT_REV_jwst' has been defined, use it to crate the spec file name + // otherwise, just use the latest package and leave out the version from the spec + // file name. + package_name = "jwst" + jwst_git_rev = sh(script: "echo \$ASCO_GIT_REV_jwst", returnStdout: true).trim() + if (jwst_git_rev != "") { + package_name = "${package_name}=${jwst_git_rev}.dev0" + } else { + jwst_git_rev = new Date().format("yyyyMMdd:HHmm") + } + cmd = "conda create -n spec -q -y -c ${this.manifest.channel_URL} -c defaults python=${PY_VERSION} ${package_name}" + sh(script: cmd) + + short_plat = CONDA_PLATFORM.tokenize("-")[0] + //short_py_ver = PY_VERSION.replaceAll(".", "") + short_py_ver = "${PY_VERSION[0]}${PY_VERSION[2]}" + specfile_name = "${specfile_type}-${jwst_git_rev}-${short_plat}-py${short_py_ver}.00.txt" + //outdir = "/eng/ssb/websites/ssbpublic/astroconda-releases-staging" + outdir = specfile_output + outfile = "${outdir}/${specfile_name}" + sh(script: "conda list -n spec --explicit > ${outfile}") + } + } + stage ("Cleanup") { // Clean up the workspace to conserve disk space. Conda installations // especially consume a fair amount. |