Hi James, Thank you for your response. Even if it's not the answer I was looking for, a clear response is helpful. :)
I'll vote for and watch the ticket. Cheers, Drew. On Sunday, July 16, 2017 at 7:39:10 PM UTC-7, James Dumay wrote: > > Hi Drew, > > There is a big of a gap in capabilities for when and where personal > credentials could be used within the Pipeline. Its near the top of the list > of things to have our Pipeline team at CloudBees fix soon. > > You can watch and vote for this ticket JENKINS-38963 > <https://issues.jenkins-ci.org/browse/JENKINS-38963> > > On Saturday, July 15, 2017 at 5:28:21 AM UTC+10, drew....@computecanada.ca > wrote: >> >> Hi all, >> >> I would like to be able to use a personal credential in Jenkins for a >> Pipeline build, and there does not appear to be a way to do this. My first >> attempt was to call `credentials('cred-id')` but this fails in the build >> with >> `org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: >> 'cred-id'`. I then found this issue in Jira: >> https://issues.jenkins-ci.org/browse/JENKINS-32417. The explanation >> given in closing the ticket: >> >> Indeed after some reasoning this looked as a not-a-defect since personal >> credentials should not appear in a job configuration. Personal credentials, >> as opposite, correctly appear if the build is parametrised with a >> credential parameter: when building a job you can successfully select the >> credentials belonging to your user. >> >> Fair enough. I then attempted to make the build a parameterized build >> with the credentials selectable on build initiation. Say I have one set up >> to take a credential as a parameter and then provide this to the pipeline. >> This leads to syntax errors in the build: >> >> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup >> failed: >> WorkflowScript: 10: Internal function call parameters must be strings. @ >> line 10, column 26. >> CREDS = credentials(env.LOGIN) >> >> >> I can access $LOGIN through the pipeline in a script block, but it does not >> appear I can make use of it with `credentials()`. *Even if I could* I >> believe it would just have the exact same problem as by explicitly naming >> the credential in the pipeline, because the parametrized build does not >> expose the credentials, just the ID. >> >> Is it possible to use personal credentials with declarative pipeline? >> >> Thanks, >> Drew. >> >> >> >> -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f217aa7d-9910-4fa0-85dc-28c682fdc43e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.