diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-10-02 13:30:53 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-10-02 13:30:53 -0400 |
commit | ea145afdb5271993f69df0d78d57fdf018dcc430 (patch) | |
tree | 4bf98202f1ea7a7c6c92e173cc6c47e7174d333a /vars | |
parent | 6d0f2fb71ba24767e30b9adfebfd82fa88537086 (diff) | |
download | jscu_refactor-ea145afdb5271993f69df0d78d57fdf018dcc430.tar.gz |
Add "DataConfig.managed" logic
Diffstat (limited to 'vars')
-rw-r--r-- | vars/utils.groovy | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 4f73fc9..76a6762 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -378,33 +378,35 @@ def stageArtifactory(config) { for (artifact in config.test_configs) { server = Artifactory.server artifact.server_id - // Construct absolute path to data - def path = FilenameUtils.getFullPath( - "${env.WORKSPACE}/${artifact.root}" - ) - - // Record listing of all files starting at ${path} - // (Native Java and Groovy approaches will not - // work here) - sh(script: "find ${path} -type f", - returnStdout: true).trim().tokenize('\n').each { - - // Semi-wildcard matching of JSON input files - // ex: - // it = "test_1234_result.json" - // artifact.match_prefix = "(.*)_result" - // - // pattern becomes: (.*)_result(.*)\\.json - if (it.matches( - artifact.match_prefix + '(.*)\\.json')) { - def basename = FilenameUtils.getBaseName(it) - def data = readFile(it) - - // Store JSON in a logical map - // i.e. ["basename": [data]] - artifact.insert(basename, data) - } - } // end find.each + if (artifact.managed) { + // Construct absolute path to data + def path = FilenameUtils.getFullPath( + "${env.WORKSPACE}/${artifact.root}" + ) + + // Record listing of all files starting at ${path} + // (Native Java and Groovy approaches will not + // work here) + sh(script: "find ${path} -type f", + returnStdout: true).trim().tokenize('\n').each { + + // Semi-wildcard matching of JSON input files + // ex: + // it = "test_1234_result.json" + // artifact.match_prefix = "(.*)_result" + // + // pattern becomes: (.*)_result(.*)\\.json + if (it.matches( + artifact.match_prefix + '(.*)\\.json')) { + def basename = FilenameUtils.getBaseName(it) + def data = readFile(it) + + // Store JSON in a logical map + // i.e. ["basename": [data]] + artifact.insert(basename, data) + } + } // end find.each + } // Submit each request to the Artifactory server artifact.data.each { blob -> |