Re: Run same Jenkins job on different repositories in parallel using Declarative Pipeline

2020-06-17 Thread 'monger_39' via Jenkins Users
peline] parallel
    [Pipeline] { (Branch: repo1)
    [Pipeline] { (Branch: repo2)
    [Pipeline] { (Branch: repo3)
    [Pipeline] stage
    [Pipeline] { (repo3)
    [Pipeline] stage
    [Pipeline] { (repo3)
    [Pipeline] stage
    [Pipeline] { (repo3)
    [Pipeline] catchError
    [Pipeline] {
    [Pipeline] catchError
    [Pipeline] {
    [Pipeline] catchError
    [Pipeline] {
    [Pipeline] build (Building check-single-repo)
    Scheduling project: check-single-repo
    [Pipeline] build (Building check-single-repo)
    Scheduling project: check-single-repo
    [Pipeline] build (Building check-single-repo)
    Scheduling project: check-single-repo
    
    Starting building: check-single-repo #230
    Starting building: check-single-repo #230
    Starting building: check-single-repo #230
    
    [Pipeline] }
    check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
    [Pipeline] }
    check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
    [Pipeline] }
    check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
    ...

As it invokes only one pipeline #230 on repo3

How to run the same Jenkins job on different repositories in parallel using 
Declarative Pipeline?


-- 
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/507c0997-e718-4f7a-ab5d-05b598f3e736o%40googlegroups.com.
  

-- 
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/831150088.126722.1592380519804%40mail.yahoo.com.


Re: Run same Jenkins job on different repositories in parallel using Declarative Pipeline

2020-06-11 Thread Devin Nusbaum
  println single_repo_jobs
> parallel single_repo_jobs
> }
> }
>
> }
> }
> }
> 
> 
> Its output:
> 
> ...
> repo1
> repo2
> repo3
> {repo1=org.jenkinsci.plugins.workflow.cps.CpsClosure2@3a396959, 
> repo2=org.jenkinsci.plugins.workflow.cps.CpsClosure2@1a4b5000, 
> repo3=org.jenkinsci.plugins.workflow.cps.CpsClosure2@1d034ac}
> [Pipeline] parallel
> [Pipeline] { (Branch: repo1)
> [Pipeline] { (Branch: repo2)
> [Pipeline] { (Branch: repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> 
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> 
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
> false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
> false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
> false to ignore)
> ...
> 
> 
> As it invokes only one pipeline #230 on repo3
> 
> 
> How to run the same Jenkins job on different repositories in parallel using 
> Declarative Pipeline?
> 
> -- 
> 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 
> <mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/d094696f-9984-4e0e-9189-66c06aee8dado%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/d094696f-9984-4e0e-9189-66c06aee8dado%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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/6232FF71-658F-4FB1-8EEC-7C3BE3D3CEE1%40cloudbees.com.


Re: Run same Jenkins job on different repositories in parallel using Declarative Pipeline

2020-06-11 Thread Roman O
heck-single-repo
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> 
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> 
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> ...
>
>
> As it invokes only one pipeline *#230* on *repo3*
>
>
> How to run the same Jenkins job on different repositories in parallel 
> using Declarative Pipeline?
>

-- 
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/d094696f-9984-4e0e-9189-66c06aee8dado%40googlegroups.com.


Re: Run same Jenkins job on different repositories in parallel using Declarative Pipeline

2020-06-11 Thread Roman O


The following code worked for me after following the example from docs 
<https://www.jenkins.io/doc/pipeline/examples/#parallel-from-list>:


pipeline { agent any options { ansiColor('xterm') } parameters { extendedChoice 
description: '', multiSelectDelimiter: ',', name: 'REPO_NAMES', quoteValue: 
false, saveJSONParameterToFile: false, type: 'PT_CHECKBOX', value: 
'repo1,repo2,repo3', visibleItemCount: 3 } stages { stage('Prepare repos to run 
on') { steps { script { def repo_names = params.REPO_NAMES.split(',') def 
single_repo_jobs = repo_names.collectEntries { ["${it}" : { catchError { 
stage(it) { build job: 'check-single-repo', parameters: [ 
string(name:'REPO_NAME', value: "${it}") ] } } } ] } parallel single_repo_jobs 
} }


On Thursday, June 11, 2020 at 4:49:15 PM UTC+3, Roman O wrote:
>
> My goal is to run the same job check-single-repo on multiple repositories 
> in parallel.
>
> Below pipeline doesn't seem to achieve the goal:
>
> pipeline {
> agent any 
> options {
> ansiColor('xterm')
> }
> parameters {
> extendedChoice description: '', multiSelectDelimiter: ',', 
> name: 'REPO_NAMES', quoteValue: false, saveJSONParameterToFile: false, 
> type: 'PT_CHECKBOX', value: 'repo1,repo2,repo3', visibleItemCount: 3
> }
> 
> stages {
> stage('Prepare repos to run on') {
> 
> steps { 
> script {  
> repo_names = params.REPO_NAMES.split(',')
> def single_repo_jobs = [:]
> for (repo_name in repo_names) {
> println repo_name
> single_repo_jobs[repo_name] = {  
> stage(repo_name) {
> catchError {
> build job: 'check-single-repo'
> ,
> parameters:
> [ 
>
> string
> (name:'REPO_NAME', value: repo_name)
> ] }
> }
> }
> }
> println single_repo_jobs
> parallel single_repo_jobs
> }
> }
>
> }
> }
> } 
>
>
> Its output:
>
> ...
> repo1
> repo2
> repo3
> {repo1=org.jenkinsci.plugins.workflow.cps.CpsClosure2@3a396959, repo2=
> org.jenkinsci.plugins.workflow.cps.CpsClosure2@1a4b5000, repo3=org.
> jenkinsci.plugins.workflow.cps.CpsClosure2@1d034ac}
> [Pipeline] parallel
> [Pipeline] { (Branch: repo1)
> [Pipeline] { (Branch: repo2)
> [Pipeline] { (Branch: repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] stage
> [Pipeline] { (repo3)
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] catchError
> [Pipeline] {
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> [Pipeline] build (Building check-single-repo)
> Scheduling project: check-single-repo
> 
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> Starting building: check-single-repo #230
> 
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> [Pipeline] }
> check-single-repo #230 repo3 completed with status UNSTABLE 
> (propagate: false to ignore)
> ...
>
>
> As it invokes only one pipeline *#230* on *repo3*
>
>
> How to run the same Jenkins job on different repositories in parallel 
> using Declarative Pipeline?
>

-- 
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/507c0997-e718-4f7a-ab5d-05b598f3e736o%40googlegroups.com.


Run same Jenkins job on different repositories in parallel using Declarative Pipeline

2020-06-11 Thread Roman O
My goal is to run the same job check-single-repo on multiple repositories 
in parallel.

Below pipeline doesn't seem to achieve the goal:

pipeline {
agent any 
options {
ansiColor('xterm')
}
parameters {
extendedChoice description: '', multiSelectDelimiter: ',', name: 
'REPO_NAMES', quoteValue: false, saveJSONParameterToFile: false, type: 
'PT_CHECKBOX', value: 'repo1,repo2,repo3', visibleItemCount: 3
}

stages {
stage('Prepare repos to run on') {

steps { 
script {  
repo_names = params.REPO_NAMES.split(',')
def single_repo_jobs = [:]
for (repo_name in repo_names) {
println repo_name
single_repo_jobs[repo_name] = {  
stage(repo_name) {
catchError {
build job: 'check-single-repo',
parameters:
[   
 
string(
name:'REPO_NAME', value: repo_name)
] }
}
}
}
println single_repo_jobs
parallel single_repo_jobs
}
}
   
}
}
} 


Its output:

...
repo1
repo2
repo3
{repo1=org.jenkinsci.plugins.workflow.cps.CpsClosure2@3a396959, repo2=
org.jenkinsci.plugins.workflow.cps.CpsClosure2@1a4b5000, repo3=org.jenkinsci
.plugins.workflow.cps.CpsClosure2@1d034ac}
[Pipeline] parallel
[Pipeline] { (Branch: repo1)
[Pipeline] { (Branch: repo2)
[Pipeline] { (Branch: repo3)
[Pipeline] stage
[Pipeline] { (repo3)
[Pipeline] stage
[Pipeline] { (repo3)
[Pipeline] stage
[Pipeline] { (repo3)
[Pipeline] catchError
[Pipeline] {
[Pipeline] catchError
[Pipeline] {
[Pipeline] catchError
[Pipeline] {
[Pipeline] build (Building check-single-repo)
Scheduling project: check-single-repo
[Pipeline] build (Building check-single-repo)
Scheduling project: check-single-repo
[Pipeline] build (Building check-single-repo)
Scheduling project: check-single-repo

Starting building: check-single-repo #230
Starting building: check-single-repo #230
Starting building: check-single-repo #230

[Pipeline] }
check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
[Pipeline] }
check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
[Pipeline] }
check-single-repo #230 repo3 completed with status UNSTABLE (propagate: 
false to ignore)
...


As it invokes only one pipeline *#230* on *repo3*


How to run the same Jenkins job on different repositories in parallel using 
Declarative Pipeline?

-- 
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/3aff4bde-6bbc-4c12-bc76-52320a01fecao%40googlegroups.com.


Re: Parallel in Declarative Pipeline

2017-02-19 Thread Baptiste Mathus
Yes, it is supported.

Le 15 févr. 2017 10:10 PM, "'pbeatty' via Jenkins Users" <
jenkinsci-users@googlegroups.com> a écrit :

I can point you to this link on Jenkins.io that describes the declarative
style and scripting style for Jenkinsfile pipeline.
https://jenkins.io/doc/book/pipeline/jenkinsfile/


On Wednesday, February 15, 2017 at 3:53:58 PM UTC-5, taroc...@gmail.com
wrote:
>
> What's declarative syntax?
>
> On Wednesday, February 15, 2017 at 11:48:22 AM UTC-8, pbeatty wrote:
>>
>> Is "parallel" valid to use in declarative Jenkinfile syntax or is it only
>> availabl Scripting syntax?
>>
>> Pat
>>
> --
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/1f2d7a1c-73e3-495e-abf3-a4877d4bcf4c%40googlegroups.
com

.

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/CANWgJS4T6HohXjgzgfjRm4bS0XgA0YCGWDenY1aFR3-04z54vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parallel in Declarative Pipeline

2017-02-15 Thread 'pbeatty' via Jenkins Users
I can point you to this link on Jenkins.io that describes the declarative 
style and scripting style for Jenkinsfile pipeline.
https://jenkins.io/doc/book/pipeline/jenkinsfile/

On Wednesday, February 15, 2017 at 3:53:58 PM UTC-5, taroc...@gmail.com 
wrote:
>
> What's declarative syntax?
>
> On Wednesday, February 15, 2017 at 11:48:22 AM UTC-8, pbeatty wrote:
>>
>> Is "parallel" valid to use in declarative Jenkinfile syntax or is it only 
>> availabl Scripting syntax?
>>
>> Pat
>>
>

-- 
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/1f2d7a1c-73e3-495e-abf3-a4877d4bcf4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parallel in Declarative Pipeline

2017-02-15 Thread tarocaravan
What's declarative syntax?

On Wednesday, February 15, 2017 at 11:48:22 AM UTC-8, pbeatty wrote:
>
> Is "parallel" valid to use in declarative Jenkinfile syntax or is it only 
> availabl Scripting syntax?
>
> Pat
>

-- 
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/ee557cf4-7bb9-4fbd-85d9-38653cffeed2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Parallel in Declarative Pipeline

2017-02-15 Thread 'pbeatty' via Jenkins Users
Is "parallel" valid to use in declarative Jenkinfile syntax or is it only 
availabl Scripting syntax?

Pat

-- 
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/f06f7941-357e-4e69-a1f7-9f6777b166ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.