Pipeline and Credentials

22 views
Skip to first unread message

Ramón Rial

unread,
Aug 31, 2016, 6:22:32 AM8/31/16
to Jenkins Developers
I have stored some credentials in my Jenkins with the help of the Credentials plugin.
These credentials are stored at Global (jenkins/credentials/store/system/domain/_).

I know that with withCredentials I can set credentials to use as environment variables as in the followin example (extracted from https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin):

node {
    withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'amazon',
                            usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
    }
}

But how can I retrieve the credentials from Jenkins and how can I use them in similar way as previous example?
If I stored the credentials (Credentials plugin asks for Username and Password), is mandatory to specify the usernameVariable and passwordVariable as in previous example?

Thank you.

Ramón Rial

unread,
Aug 31, 2016, 8:03:37 AM8/31/16
to Jenkins Developers
Sorry, I missunderstood this code.

The example is good for me.
This thread is closed now.
Reply all
Reply to author
Forward
0 new messages