diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2019-05-10 14:00:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 14:00:37 -0400 |
commit | 27aa04e653014888fa203204150eefc4bc804804 (patch) | |
tree | 3075df41299c7bf7081405bc11b3a0ab0cf33850 | |
parent | 61fdd601b48119d4e18329dd3d2c290f69ef2850 (diff) | |
download | jscu_refactor-27aa04e653014888fa203204150eefc4bc804804.tar.gz |
Quote filenames passed to sed for robustness (#49)
* Test env dump on CI system
* Quote filenames in sed calls to accommodate spaces
* Quote dump_name for robustness.
* Correct jenkinsfile
-rw-r--r-- | Jenkinsfile | 3 | ||||
-rw-r--r-- | vars/utils.groovy | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 1a7ff4c..0703725 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,4 @@ +@Library('utils@test_yml') _ // [skip ci] and [ci skip] have no effect here. if (utils.scm_checkout(['skip_disable':true])) return @@ -51,7 +52,7 @@ bc1.test_cmds[1] = "${PYTEST} tests/test_25pass.py" bc2 = utils.copy(bc0) bc2.name = 'Third build config' -bc2.conda_packages = [] +bc2.conda_packages = ['python=3.6'] bc2.build_cmds = ["which python"] bc2.test_cmds = ["ls -al"] bc2.test_configs = [] diff --git a/vars/utils.groovy b/vars/utils.groovy index b38d362..1676841 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -513,15 +513,15 @@ def buildAndTest(config) { commit = sh(script: "git rev-parse HEAD", returnStdout: true).trim() // Remove 'prefix' line as it isn't needed and complicates the // addition of the 'pip' section. - sh(script: "sed -i '/prefix/d' ${dump_name}") - pip_section = sh(script: "grep 'pip:' ${dump_name}", returnStatus: true) + sh(script: "sed -i '/prefix/d' '${dump_name}'") + pip_section = sh(script: "grep 'pip:' '${dump_name}'", returnStatus: true) if (pip_section != 0) { - sh "echo ' - pip:' >> ${dump_name}" + sh "echo ' - pip:' >> '${dump_name}'" } // Add git+https line in pip section to install the commit // used for the target project of this job. extra_yml_1 = " - ${remote_repo}@${commit}" - sh "echo '${extra_yml_1}' >> ${dump_name}" + sh "echo '${extra_yml_1}' >> '${dump_name}'" // Stash spec file for use on master node. stash includes: '**/conda_env_dump*', |