[jenkins-workflow] How to inject a password in an "sh" step? Credentials Binding Plugin?

104 views
Skip to first unread message

Cyrille Le Clerc

unread,
Jan 19, 2015, 5:59:18 PM1/19/15
to jenkins...@googlegroups.com, Tom Fennelly
Dear community,

Could someone explain me how to retrieve in a Jenkins workflow a password that has been declared as a username/password in the Jenkins Credentials store?

Is it possible to use the Credentials Binding Plugin in a workflow? Does this plugin need to be updated to work in a workflow?

Cyrille

Timur Batyrshin

unread,
Jan 20, 2015, 6:22:04 AM1/20/15
to jenkins...@googlegroups.com, tfen...@cloudbees.com
Hi Cyrille,


For cloning repositories I use the credentialsId, like:

checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: 'remotes/origin/master']], userRemoteConfigs: [[credentialsId: '6ab75e78-83c6-423f-97ce-3198c52211a7', url: 'https://github.com/XXXXX']]]

You can find the ID in URL line if you open the Jenkins page holding the credentials.


I think I've seen a ticket in JIRA about specifying these via usernames but they were not yet resolved.

Regards,
Timur

вторник, 20 января 2015 г., 1:59:18 UTC+3 пользователь Cyrille Le Clerc написал:

Jesse Glick

unread,
Feb 25, 2015, 5:54:56 PM2/25/15
to jenkins...@googlegroups.com, tfen...@cloudbees.com
On Monday, January 19, 2015 at 5:59:18 PM UTC-5, Cyrille Le Clerc wrote:
Is it possible to use the Credentials Binding Plugin in a workflow? Does this plugin need to be updated to work in a workflow?

Update: yes, and it was (the next day). 
Reply all
Reply to author
Forward
0 new messages