|
||||||||
|
This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira |
||||||||
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

There are several possible designs here:
step([$class: 'SecretBuildWrapper', bindings: [[$class: 'StringBinding', variable: 'SECRET', credentialsId: 'mysecret']]]) { sh 'echo $SECRET' writeFile file: 'secret.txt', text: env.SECRET }withCredentials([[$class: 'StringBinding', variable: 'SECRET', credentialsId: 'mysecret']]) { sh 'echo $SECRET' writeFile file: 'secret.txt', text: env.SECRET }withCredentials(localVar: 'secrets', bindings: [[$class: 'StringBinding', variable: 'secret', credentialsId: 'mysecret']]) { sh "echo ${secrets.secret}" writeFile file: 'secret.txt', text: secrets.secret }withCredentials(localVar: 'secret', binding: [$class: 'NoVarStringBinding', credentialsId: 'mysecret']) { sh "echo ${secret}" writeFile file: 'secret.txt', text: secret }