From a5ad271a525cdd1d637a664bd0360848d229e440 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 8 Oct 2019 10:28:05 -0400 Subject: Refactor package structure --- src/BuildConfig.groovy | 46 ----------------------------------- src/DataConfig.groovy | 40 ------------------------------ src/JobConfig.groovy | 23 ------------------ src/edu/stsci/jscu/BuildConfig.groovy | 46 +++++++++++++++++++++++++++++++++++ src/edu/stsci/jscu/DataConfig.groovy | 40 ++++++++++++++++++++++++++++++ src/edu/stsci/jscu/JobConfig.groovy | 23 ++++++++++++++++++ 6 files changed, 109 insertions(+), 109 deletions(-) delete mode 100644 src/BuildConfig.groovy delete mode 100644 src/DataConfig.groovy delete mode 100644 src/JobConfig.groovy create mode 100644 src/edu/stsci/jscu/BuildConfig.groovy create mode 100644 src/edu/stsci/jscu/DataConfig.groovy create mode 100644 src/edu/stsci/jscu/JobConfig.groovy (limited to 'src') diff --git a/src/BuildConfig.groovy b/src/BuildConfig.groovy deleted file mode 100644 index 0b3cc06..0000000 --- a/src/BuildConfig.groovy +++ /dev/null @@ -1,46 +0,0 @@ -// 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/DataConfig.groovy b/src/DataConfig.groovy deleted file mode 100644 index 37adf88..0000000 --- a/src/DataConfig.groovy +++ /dev/null @@ -1,40 +0,0 @@ -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/JobConfig.groovy b/src/JobConfig.groovy deleted file mode 100644 index cd299b6..0000000 --- a/src/JobConfig.groovy +++ /dev/null @@ -1,23 +0,0 @@ -// 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() {} -} 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() {} +} -- cgit