How to parametrize credentials for Git Plugin?

24 views
Skip to first unread message

Andrew Pashkin

unread,
Sep 30, 2016, 10:07:49 AM9/30/16
to Jenkins Users

Hello, everybody!


I'm using Git Plugin for my project and it's possible to parametrize many of it's options though the regular way of using environment variables substitution, like " Repository URL: ${MY_PARAMETER}". But this is not the case for the "Credentials" parameter - it's a dropdown and it's impossible to parametrize it.


So my problem is - how to parametrize "Credentials" parameter, to make user be able to set it though "Build with parameters" UI?


p.s.

I also use Active Choices Plugin, which allows you to generate parameters for a job using Groovy scripts. If it's impossible to parametrize "Credentials" in a regular way, maybe it's possible to set it using Java API? So I would be able to write in my script something like jenkinsProject.setSetting('credentialsID', 'c9a78310-3bae-4747-b964-aff9a451c513')?

Andrew Pashkin

unread,
Sep 30, 2016, 10:09:05 AM9/30/16
to Jenkins Users
Ooops, a duplicate thread, please ignore this one and use:
Reply all
Reply to author
Forward
0 new messages