diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2019-02-13 16:51:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 16:51:45 -0500 |
commit | b18a2555e6e6a83514897b042747d987760fe01c (patch) | |
tree | f77f4cae049f5c6a79376ec7d0d6f10237c76b05 /vars/utils.groovy | |
parent | 477c44df4495996b196e3566f32eab7b4a7d209d (diff) | |
download | jscu_refactor-b18a2555e6e6a83514897b042747d987760fe01c.tar.gz |
Determine correct conda path before dumping environment (#34)1.3.4
Diffstat (limited to 'vars/utils.groovy')
-rw-r--r-- | vars/utils.groovy | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 21d765c..9847f0a 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -417,8 +417,16 @@ def buildAndTest(config, index) { } // end test test_cmd finally clause } // end if(config.test_cmds...) + // Dump the conda environment definition to a file. - sh(script: "${env.WORKSPACE}/miniconda/bin/conda list --explicit > env_dump_${index}.txt") + def conda_exe = '' + local_conda = "${env.WORKSPACE}/miniconda/bin/conda" + if (fileExists(local_conda)) { + conda_exe = local_conda + } else { + conda_exe = sh(script:"which conda", returnStdout:true).trim() + } + sh(script: "${conda_exe} list --explicit > env_dump_${index}.txt") } // end withEnv } |