diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2019-03-21 12:38:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 12:38:13 -0400 |
commit | 362ed861198e0ff15bbf4df8e5c048ca20e975b4 (patch) | |
tree | 5cfc384cc755b931d56391b971d4acc30c9a7ce5 /vars | |
parent | fd66dd6dcd026ff3cc0651bd3f5e83e3f1f84e8c (diff) | |
download | jscu_refactor-362ed861198e0ff15bbf4df8e5c048ca20e975b4.tar.gz |
Test secret injection (#42)
Provide default credentials property in JobConfig class
Convert credential env var value to java string
Remove display of env var values.
Diffstat (limited to 'vars')
-rw-r--r-- | vars/utils.groovy | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 7b74187..8a7c00e 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -622,7 +622,6 @@ def expandEnvVars(config) { // @param config BuildConfig object def abortOnGstrings(config) { config.env_vars.each { evar -> - println(evar) if (evar.getClass() == org.codehaus.groovy.runtime.GStringImpl) { msg = "Immediate interpolation of variables in the 'env_vars'" + " list is not supported and will probably not do what" + @@ -689,6 +688,16 @@ def run(configs, concurrent = true) { // Loop over config objects passed in handling each accordingly. buildconfigs.eachWithIndex { config, index -> + // Make any requested credentials available to all build configs + // in this job via environment variables. + if (jobconfig.credentials != null) { + jobconfig.credentials.each { cred_id -> + withCredentials([string(credentialsId: cred_id, variable: 'cred_id_val')]) { + config.env_vars.add("${cred_id}=${cred_id_val}".toString()) + } + } + } + def BuildConfig myconfig = new BuildConfig() // MUST be inside eachWith loop. myconfig = SerializationUtils.clone(config) |