Re: Fetching pipeline script from Git

2016-02-16 Thread Baptiste Mathus
Hi, the `parallel` step actually expects a map, not an array/list.

That is, should be:

 `buildClosures = []`

and something like

buildClosures.put("the subbuild $i", curClosure)

Cheers

2016-02-16 11:50 GMT+00:00 Tomasz Szandała :

> Greetings, All,
> I have the following script fetched from Git using Pipeline Git plugin.
> Unortunatelly I'm getting the following error:
>
>
> *org.kohsuke.stapler.NoStaplerConstructorException: There's no 
> @DataBoundConstructor on any constructor of class 
> org.jenkinsci.plugins.workflow.cps.steps.ParallelStep
>   at 
> org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:177)*
>
>
> Th fetched script:
> import hudson.FilePath
>
> def make_all(currentBuild){
> String[] arr = getProperty("MODULES_LIST").split(",");
> currentBuild.description = basic_desc
> main_build = build("MAINBUILD")
> buildClosures = []
>
> for (int i=0; i println "adding "+arr[i]
> String tmpserv=arr[i].replaceAll("\"","")
> def curClosure = {
> println "Scheduling "+tmpserv.replaceAll("\"","")
> retry (2) {
>   tmp_build = build("parrallel_test",
>  "MODULE": arr[i],
> "MAIN_BUILD_NUM": main_build.number
> )
> }
> tmp_build.build.artifacts.each {
>   //copying artifacts
> }
> jobs_done += 1
> currentBuild.description = "Subjobs done: " + jobs_done.toString()
> +"/" + total_jobs.toString() + " "
> }
> buildClosures.add(curClosure)
> }
> parallel(buildClosures)
> }
> return this;
>
> And the fetching script:
>
> def factory = fileLoader.fromGit('factory.groovy',
> 'git_path', 'master', null, '');
>
> factory.make_all(currentBuild)
>
>
> --
> 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/60d08754-ed16-482e-93c8-bc09bbc1c6d4%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/CANWgJS425Ni010Tc9ZDemNdyDP8KwqVyOCFp-yrK6P3V6zRLhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Fetching pipeline script from Git

2016-02-16 Thread Tomasz Szandała
Greetings, All,
I have the following script fetched from Git using Pipeline Git plugin. 
Unortunatelly I'm getting the following error:


*org.kohsuke.stapler.NoStaplerConstructorException: There's no 
@DataBoundConstructor on any constructor of class 
org.jenkinsci.plugins.workflow.cps.steps.ParallelStep
at 
org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:177)*


Th fetched script:
import hudson.FilePath

def make_all(currentBuild){
String[] arr = getProperty("MODULES_LIST").split(",");
currentBuild.description = basic_desc
main_build = build("MAINBUILD")
buildClosures = []

for (int i=0; i