[Credentials Binding Plugin] How to specify the domain in withCredentials?

2017-12-10 Thread Yuri Govorushchenko
Hello,

I put credentials with same ids into different domains and thus need a way 
to specify the domain name on invoking `withCredentials` step in my script 
pipeline. Is it possible?
As a workaround currently I have to find the creds manually, but this 
approach lacks the password masking provided by the plugin:

```

def fetchCred(String domainName, String id) {
def credentialsStore = 
Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore()
def domain = new Domain(domainName, null, null)
def creds = credentialsStore.getCredentials(domain)
def cred = creds.find { it.id == id }
assert (cred != null)
cred
}

```

Thanks.

-- 
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/593f9611-118d-412e-9fc9-018db9b47e19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to set Multibranch Pipeline Trigger interval via Jenkinsfile?

2017-07-27 Thread Yuri Govorushchenko
Thank you Stephen! After fixing typos it worked for me from Script Console:

for (f in 
Jenkins.instance.getAllItems(jenkins.branch.MultiBranchProject.class)) {
  if (f.parent instanceof jenkins.branch.OrganizationFolder) {
// managed by org folder, leave alone
continue;
  }
  // addTrigger will replace an existing one
  f.addTrigger(new 
com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger("1d"));
}

Maybe in the future I'll be able to somehow incorporate this code into a 
JobDSL seed job to fully automate the definition of my multibranch job.

On Thursday, July 27, 2017 at 2:59:23 PM UTC+3, Stephen Connolly wrote:
>
> Cannot be done from a Jenkinsfile.
>
> You can do via the groovy console with something like
>
> for (var f in 
> Jenkins.instance.getAllItems(jenkins.branch.MultiBranchProject.class) {
>   if (f.parent instanceof jenkins.branch.OrganizationFolder) {
> // managed by org folder, leave alone
> continue;
>   }
>   // addTrigger will replace an existing one
>   f.addTrigger(new 
> com.cloudbees.hudson.plugins.folder.computedPeriodicFolderTrigger("1d"));
> }
>
> On 26 July 2017 at 20:03, Ramanathan Muthaiah <rus.c...@gmail.com 
> > wrote:
>
>> On Thursday, July 27, 2017 at 5:12:55 AM UTC+5:30, Yuri Govorushchenko 
>> wrote:
>>>
>>> Hello,
>>>
>>> I have a *Multibranch Pipeline* job and would like to programatically 
>>> set its property found in UI at *Scan Multibranch Pipeline Triggers -> 
>>> Periodically if not otherwise run -> Interval*. Ideally I'd like to do 
>>> it in a scripted *Jenkinsfile* used to define the job. Maybe it can be 
>>> somehow achieved via properties step? It seems to be a property of 
>>> CloudBees Folders Plugin 
>>> <https://wiki.jenkins.io/display/JENKINS/CloudBees+Folders+Plugin> but 
>>> I couldn't figure out how it can be modified without a UI.
>>>
>>
>> We are on the same boat . . . would be interested to know how this can be 
>> done; if you hit upon the solution, pls do share here.
>>
>> /Ram 
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/ace70cd8-afa6-4966-a82c-e449cad3eeef%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/ace70cd8-afa6-4966-a82c-e449cad3eeef%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/8cf5771d-a47a-461a-9668-dd66e3a327a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to set Multibranch Pipeline Trigger interval via Jenkinsfile?

2017-07-26 Thread Yuri Govorushchenko
Hello,

I have a *Multibranch Pipeline* job and would like to programatically set 
its property found in UI at *Scan Multibranch Pipeline Triggers -> 
Periodically if not otherwise run -> Interval*. Ideally I'd like to do it 
in a scripted *Jenkinsfile* used to define the job. Maybe it can be somehow 
achieved via properties step? It seems to be a property of 
CloudBees Folders Plugin 
 but I 
couldn't figure out how it can be modified without a UI.

Thanks.

-- 
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/d5304260-8e49-4ad1-b302-9b8b685973cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.