Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 1.17
Excerpt

Allows credentials to be bound to environment variables for use from miscellaneous build steps.

Wiki Markup
{jenkins-plugin-info:pluginId=credentials-binding|sourceDir=credentials-binding-plugin}

You may have a keystore for jarsigner, a list of passwords, or other confidential files or strings which you want to be used by a job but which should not be kept in its SCM, or even visible from its config.xml. Saving these files on the server and referring to them by absolute path requires you to have a server login, and does not work on slaves. This plugin gives you an easy way to package up all a job’s secret files and passwords and access them using a single environment variable during the build.

...

No Format
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.17 (2018-10-29)

  • Improved stream flush behavior in light of JEP-210.

Version 1.16 (Mar 19, 2018)

  • Jira
    serverJenkins JIRA
    serverIddd058dce-0c66-3b77-8b09-71b1d7728747
    keyJENKINS-49535
  • Improving help text in light of 
    Jira
    serverJenkins JIRA
    serverIddd058dce-0c66-3b77-8b09-71b1d7728747
    keyJENKINS-50242
    .

...