aboutsummaryrefslogtreecommitdiff
path: root/jenkins/job-suite-generator.groovy
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-04-07 14:34:56 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-04-07 14:34:56 -0400
commit58a590aa4995d4ab005a0d25a4e6e914d0460c30 (patch)
tree05a41496625a573990d7b6a9a2bad823328791bc /jenkins/job-suite-generator.groovy
parent33f69dbeda8eb277f8485b9d8a3113c41a3e33ad (diff)
downloadbuild_control-58a590aa4995d4ab005a0d25a4e6e914d0460c30.tar.gz
Build granularity implementation
Diffstat (limited to 'jenkins/job-suite-generator.groovy')
-rw-r--r--jenkins/job-suite-generator.groovy45
1 files changed, 45 insertions, 0 deletions
diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy
new file mode 100644
index 0000000..9130d37
--- /dev/null
+++ b/jenkins/job-suite-generator.groovy
@@ -0,0 +1,45 @@
+// Top-level pipeline job that provides parameterized machinery for
+// creating one or more build job suites for use in building AstroConda
+// package sets.
+// Uses Job-DSL plugin.
+
+// Directory into which supporting libraries are stored. Gets added to
+// groovy classpath definition prior to imports.
+this.ldir = "libs"
+
+node("master") {
+
+ stage("Prep") {
+ // Delete any existing job workspace directory contents.
+ deleteDir()
+
+ // These variables are provided by the execution of the generator
+ // build task with parameters. Each var is populated by a parameter
+ // specification.
+ sh "echo manifest_file=${this.manifest_file}"
+ sh "echo label=${this.label}"
+ sh "echo py_version=${this.py_version}"
+ sh "echo old_jobs_action=${this.old_jobs_action}"
+ }
+
+ stage("Setup") {
+ sh "mkdir -p ${this.ldir}"
+ // Obtain libraries to facilitate job generation tasks.
+ dir ("libs") {
+ sh "curl -O https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar"
+ }
+ // Copy files from the implicit checkout of the build_control directory (handled by
+ // the job that reads this pipeline script) into the actual workspace of this job so
+ // the jobDsl call below will be able to find what it needs.
+ sh "cp -r ${env.WORKSPACE}@script/* ."
+ }
+
+ stage('Spawn job definitions') {
+ jobDsl targets: ["jenkins/generator_DSL.groovy"].join('\n'),
+ lookupStrategy: "SEED_JOB",
+ additionalClasspath: ["${this.ldir}/*.jar"].join('\n'),
+ removeAction: "${this.old_jobs_action}"
+ }
+
+}
+