credentials-binding-plugin: Is it intentional that it doesn't expand parameters of type "choice"?

14 views
Skip to first unread message

Ilia Basin

unread,
Jan 31, 2018, 4:11:17 PM1/31/18
to Jenkins Users
Hi.
Here's my use case: I have 6 credentials of type "secret file". Their IDs are:

    project1_integration
    project1_acceptance
    project1_production
   
    project2_integration
    project2_acceptance
    project2_production
   
I also have two projects project1 and project2. I want project1 to have a dropdown parameter that would allow to choose one of three secret files and project2 to have its own dropdown to choose one of the other three secret files.

I tried to create a simple choice parameter with name: CREDS_ID and allowed values being the credentials IDs. Then I checked "Use secret text(s) or file(s)" and entered the expression ${CREDS_ID} . The build failed with "CredentialNotFoundException", just like here: https://issues.jenkins-ci.org/browse/JENKINS-31946?focusedCommentId=243381&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-243381

If instead I create a parameter of type "Credentials", the expansion works fine. It's strange, because in the end the plugin calls findCredentialById() which accepts the string id. With this parameter the dropdown contains all 6 credentials. I see no decent way to limit them.
Reply all
Reply to author
Forward
0 new messages