Created
November 18, 2016 15:36
-
-
Save m-x-k/a2193e3c42b4a31e64c7ba3db0e6fa92 to your computer and use it in GitHub Desktop.
Jenkins Pipeline sample using Credentials Binding Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage('GetUserCredential') { | |
// Requires Credential setup (MyCredentialID) | |
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyCredentialID', | |
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { | |
sh ''' | |
set +x | |
echo "$USERNAME" > output.txt | |
''' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment