...
Code Block | ||
---|---|---|
| ||
withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { // available as an env variable, but will be masked if you try to print it out any which way // note: single quotes prevent Groovy interpolation; expansion is by Bourne Shell, which is what you want sh 'echo $PASSWORD' // also available as a Groovy variable echo USERNAME // or inside double quotes for string interpolation echo "username is $USERNAME" } |
Changelog
Version 1.19 (2019-05-31)
Expanded secret masking to include some variants commonly produced by shells when metacharacters are involved.Jira server Jenkins JIRA serverId dd058dce-0c66-3b77-8b09-71b1d7728747 key JENKINS-42950
Version 1.18 (2019-02-25)
Better documentation about limitations and best practices.Jira server Jenkins JIRA serverId dd058dce-0c66-3b77-8b09-71b1d7728747 key JENKINS-42950
Avoiding blocking the Pipeline interpreter during block cleanup even if Remoting hangs.Jira server Jenkins JIRA serverId dd058dce-0c66-3b77-8b09-71b1d7728747 key JENKINS-49337 - Avoid printing a stack trace when a
credentialsId
is not found.
Version 1.17 (2018-10-29)
- Improved stream flush behavior in light of JEP-210.
...