Hi,

When running a Build Flow DSL with parallel jobs, I am getting the following 
error message:

ERROR: Failed to run DSL Script
groovy.lang.MissingMethodException<http://stacktrace.jenkins-ci.org/search?query=groovy.lang.MissingMethodException>:
 No signature of method: com.cloudbees.plugins.flow.FlowDelegate.paralllel() is 
applicable for argument types: (Script1$_executeBuild_closure4, 
Script1$_executeBuild_closure5) values: [Script1$_executeBuild_closure4@71be63, 
Script1$_executeBuild_closure5@18a621e]
Possible solutions: parallel([Lgroovy.lang.Closure;), 
parallel(java.util.Collection), parallel(java.util.Map)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

I understand why I am getting this error... it makes total sense... but let me 
explain what I am trying to do...

I encapsulated builds in a method named 'myBuild' so that I did not have to 
repeat DSL logic (i.e. I can skip and ignore steps based on properties).

myBuild(projectMap,releaseBuild) {
    if (projectMap['skip']) {
        println "Skipping "+projectMap['name']+" "+projectMap
    } else {
        println "Building "+projectMap+" ; releaseBuild=${releaseBuild}"
        if (projectMap['ignore']) {
            ignore(FAILURE) {
                build(projectMap['jenkinsProject'], 
GIT_BRANCH_OR_TAG:projectMap['branch'], RELEASE_BUILD: releaseBuild)
            }
        } else {
            build(projectMap['jenkinsProject'], 
GIT_BRANCH_OR_TAG:projectMap['branch'], RELEASE_BUILD: releaseBuild)
        }
    }
}

Then, my DSL was very simple:

// set up a project Map that specifies whether to ignore failures or skip 
steps. Also, set up the releseBuild Boolean parameter.
...
// Here is a snippet of DSL code that "blows up" with 
groovy.lang.MissingMethodException<http://stacktrace.jenkins-ci.org/search?query=groovy.lang.MissingMethodException>
parallel {
  { myBuild(projectMap['project1'],releaseBuild) },
  { myBuild(projectMap['project2'],releaseBuild) },
  { myBuild(projectMap['project3'],releaseBuild) }
}

Using my technique, the DSL is concise and very flexible. This is my first time 
using the Build Flow Plugin so I am wondering whether anyone else had tried to 
do this type of thing and whether they found a workaround... I know I can get 
it to work without using the myBuild method; however, if I could make use of 
that method, it would greatly simplify the DSL and make it much more 
maintainable.

Any ideas?

Thanks for taking the time to read this.

Bob

*** *** ***
This message contains information which may be confidential and privileged. 
Unless you are the addressee (or authorized to receive for the addressee), you 
may not use, copy or disclose to anyone the message or any information 
contained in the message. If you have received the message in error,  please 
advise the sender by reply e-mail and delete the message.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to