It just doesn't run. 

I've seen this behavior with the maven settings file, if you specify 
something that could not be found, the code within the block is just 
skipped. 

I've made sure to use the ugly ID in my script, but I didn't put it in my 
example for clarity.

That no credentials appear in the generator combobox looks like it's more 
than just a bad ID. I'm not entirely clear how credentials propagate to 
child jobs / folders, maybe I need to do something at the multibranch 
pipeline level to propagate credentials to generated child jobs?

On Wednesday, July 27, 2016 at 7:08:51 PM UTC-4, Michael Neale wrote:
>
> Should the credentialsId be the horrible ugly ID in advanced in 
> credentials? 
>
> is there no error, but it just doesn't run? 
>
> On Thursday, July 28, 2016 at 7:34:51 AM UTC+10, Francis Lalonde wrote:
>>
>> Hi -
>>
>> I am writing a Jenkinsfile script to automate the creation of pipelines 
>> using the multibranch plugin. The Jenkinsfile appears at the root of a 
>> github repo. Branch Indexing is working fine and the first stages (Maven 
>> commands) go trough without a hitch.
>>
>> But then I am trying to deploy using ansible, for which I need ssh. I 
>> have defined a global-scoped "secret-file" credentials, which regular jobs 
>> can see and use. But my script-generated jobs do not get access to the 
>> credentials.
>>
>> In the following sample code, the echo command never runs : 
>>
>> node() {
>>     withCredentials([[$class: 'FileBinding', credentialsId: 
>> 'secret-file', variable: 'SECRET_FILE']]) {
>>         echo "${SECRET_FILE}"
>>     }
>> }
>>
>> Moreover, using the "withCredentials" Pipeline Syntax Snippet Generator 
>> at the branch job level, the combobox does not list any available 
>> credentials. But doing the same thing a level above (in the multibranch 
>> job), the combobox shows all global-scoped credentials, including the 
>> "secret-file" which I am looking to use in my script.
>>
>> I don't know if this is an intentional limitation, either by design or 
>> for security, that can be configured or worked around or if it is a plain 
>> bug that I should file an issue for. I tried both freshly installed Windows 
>> Jenkins 2.15 and an older 1.651.3 Linux Jenkins with updated plugins and 
>> got the same behvaior.
>>
>> If anybody has a clue, this would make my week!
>>
>> Francis
>>
>>
>>

-- 
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/66c1edb5-6358-43d6-b36a-05f62aab77d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to