aboutsummaryrefslogtreecommitdiff
path: root/src/edu
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-10-08 10:28:05 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-10-08 10:28:05 -0400
commita5ad271a525cdd1d637a664bd0360848d229e440 (patch)
tree26eadbcb31c1f6d534a7ba72e8ae0007e5cd0b6e /src/edu
parent2b2f452d1724b4db9df4c9065b2ad51acdaf4910 (diff)
downloadjscu_refactor-a5ad271a525cdd1d637a664bd0360848d229e440.tar.gz
Refactor package structure
Diffstat (limited to 'src/edu')
-rw-r--r--src/edu/stsci/jscu/BuildConfig.groovy46
-rw-r--r--src/edu/stsci/jscu/DataConfig.groovy40
-rw-r--r--src/edu/stsci/jscu/JobConfig.groovy23
3 files changed, 109 insertions, 0 deletions
diff --git a/src/edu/stsci/jscu/BuildConfig.groovy b/src/edu/stsci/jscu/BuildConfig.groovy
new file mode 100644
index 0000000..0b3cc06
--- /dev/null
+++ b/src/edu/stsci/jscu/BuildConfig.groovy
@@ -0,0 +1,46 @@
+// src/BuildConfig.groovy
+
+class BuildConfig implements Serializable {
+ def nodetype = ""
+ def name = ""
+
+ def conda_packages = []
+ def conda_override_channels = false
+ def conda_channels = []
+ def conda_ver = null
+
+ def env_vars = []
+ def env_vars_raw = []
+ def build_cmds = []
+ def test_cmds = []
+ def test_configs = []
+
+ def failedFailureNewThresh = ''
+ def failedFailureThresh = ''
+ def failedUnstableNewThresh = ''
+ def failedUnstableThresh= '0'
+
+ def skippedFailureNewThresh = ''
+ def skippedFailureThresh = ''
+ def skippedUnstableNewThresh = ''
+ def skippedUnstableThresh= ''
+
+ // Scheduling - default behavior is to not restrict run schedule based on
+ // the day of the week.
+ def run_on_days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
+
+ // Private. Not to be used directly by Jenkinsfile.
+ def runtime = []
+
+ // Constructors
+ BuildConfig() {
+ this.nodetype = ""
+ }
+}
+
+
+class testInfo implements Serializable {
+ def problems = false
+ def subject = ""
+ def message = ""
+}
diff --git a/src/edu/stsci/jscu/DataConfig.groovy b/src/edu/stsci/jscu/DataConfig.groovy
new file mode 100644
index 0000000..37adf88
--- /dev/null
+++ b/src/edu/stsci/jscu/DataConfig.groovy
@@ -0,0 +1,40 @@
+import groovy.json.JsonOutput
+import org.apache.commons.io.FileUtils
+
+class DataConfig implements Serializable {
+ String root = '.'
+ String server_id = ''
+ String match_prefix = '(.*)'
+ String direction
+ Boolean managed = true
+ Boolean keep_data = false
+ int keep_builds = 20
+ int keep_days = 10
+ def data = [:]
+
+ DataConfig(String direction = "upload") {
+ this.direction = direction.toLowerCase()
+ //if (!this.isUpload() && !this.isDownload()) {
+ // throw new Exception("DataConfig.direction argument must be 'upload'"
+ // + "or 'download' (got: ${this.direction})")
+ //}
+ }
+
+ def isUpload() {
+ return this.direction.startsWith('u')
+ }
+
+ def isDownload() {
+ return this.direction.startswith('d')
+ }
+
+ def insert(String name, String block) {
+ /* Store JSON directly as string */
+ this.data[name] = block
+ }
+
+ def insert(String name, block=[:]) {
+ /* Convert a Groovy Map to JSON and store it */
+ this.data[name] = JsonOutput.toJson(block)
+ }
+}
diff --git a/src/edu/stsci/jscu/JobConfig.groovy b/src/edu/stsci/jscu/JobConfig.groovy
new file mode 100644
index 0000000..cd299b6
--- /dev/null
+++ b/src/edu/stsci/jscu/JobConfig.groovy
@@ -0,0 +1,23 @@
+// src/JobConfig.groovy
+
+class JobConfig implements Serializable {
+
+ // Regression testing summary control
+ def post_test_summary = false
+ def all_posts_in_same_issue = true
+
+ // Conda environment specification file publication control
+ def enable_env_publication = false
+ def publish_env_on_success_only = true
+
+ def credentials = null
+
+ // Build retention control
+ def builds_to_keep = -1
+
+ // Development
+ def debug = false
+
+ // Constructors
+ JobConfig() {}
+}