aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2017-10-16 17:51:58 -0400
committerGitHub <noreply@github.com>2017-10-16 17:51:58 -0400
commit777342c08ede3df2cca1168e873797c5f77455ce (patch)
tree1f8b1cf0575a89c57291df927332ec8be6d28445
parent038c03cfd2d9f0b20285c4e4eca6487f85ba7f56 (diff)
parenta5bf7e7fc72a2af30d5449d16bffc3a8f4a6011d (diff)
downloadbuild_control-777342c08ede3df2cca1168e873797c5f77455ce.tar.gz
Merge pull request #42 from rendinam/log_purge1.0.9
Add parameter to control number of builds/logs kept per job.
-rw-r--r--jenkins/generator_DSL.groovy17
1 files changed, 17 insertions, 0 deletions
diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy
index fe6c8f2..b9a3967 100644
--- a/jenkins/generator_DSL.groovy
+++ b/jenkins/generator_DSL.groovy
@@ -20,6 +20,17 @@ this.build_control_branch= this.build_control_branch.trim()
this.build_control_tag = readFileFromWorkspace("VAR-build_control_tag")
this.build_control_tag = this.build_control_tag.trim()
+// Keep a specified number of builds (purging those older upon next
+// job execution) for each independent job that is created. This value is set
+// as one of the updater job's parameters.
+// Note: Since the _dispatch job is
+// executed at the highest frequency, its saved build logs will not go as far
+// back in time for a given value of builds_to_keep than a similar collection
+// of kept logs for a less frequently built job, a slowly-moving package, for
+// instance.
+println("builds_to_keep: ${builds_to_keep}")
+this.num_builds_to_keep = builds_to_keep.toInteger()
+
// For each label (OS) in the list provided by the 'labels' job parameter, iterate
// over each python version provided by the 'py_versions' job parameter, to obtain
// every combination of OS and python version. Generate a separate job suite for
@@ -55,6 +66,9 @@ for (label in labels.trim().tokenize()) {
"package file name that already exists in the manfest's" +
" channel archive are removed from the build list.")
}
+ logRotator {
+ numToKeep(this.num_builds_to_keep)
+ }
println("\n" +
"script: ${this.script}\n" +
"MANIFEST_FILE: ${manifest_file}\n" +
@@ -102,6 +116,9 @@ for (label in labels.trim().tokenize()) {
env("JOB_DEF_GENERATION_TIME", job_def_generation_time)
env("CONDA_BUILD_VERSION", conda_build_version)
}
+ logRotator {
+ numToKeep(this.num_builds_to_keep)
+ }
parameters {
stringParam("label",
"label-DEFAULTVALUE",