job dsl problem: groovyScriptFile statement does not create a build step

155 views
Skip to first unread message

Simon Haegler

unread,
Sep 14, 2015, 1:54:47 PM9/14/15
to Jenkins Users
hi jenkins users,

i am working on our in-house 3rd-party dependency build system and ran into an issue that the JOB DSL statement "groovyScriptFile" does not create the corresponding build step. here is the relevant snippet from the seed job groovy script:

steps {
  groovyScriptFile
("${scriptPath}/${pkg.name}-${pkg.version}-build.groovy") {
    groovyInstallation
('groovy-2.4.4')
    classpath
(SCRIPT_REPO.basePath)
 
}
  maven
{
   
// ...
 
}
}


the seed job runs fine and there is no error:

Processing DSL script boost_dsl.groovy
Adding items:
   
GeneratedJob{name='boost-1.59.0-osx1010-ac610-x86_64'}
Finished: SUCCESS

but the created job does not contain the expected "execute groovy script file" build step, just the maven step.

any ideas? e.g. how to increase log verbosity of the JOB DSL?

TIA,
simon

Simon Haegler

unread,
Sep 14, 2015, 1:57:39 PM9/14/15
to Jenkins Users
apologies, forgot the versions:
- jenkins 1.609.3
- job dsl plugin 1.38
- groovy plugin 1.27

Victor Martinez

unread,
Sep 14, 2015, 5:22:49 PM9/14/15
to Jenkins Users
Hi Simon, 

 A few suggestions in case you haven't checked them  yet:

  - Can you check your config.xml file? %YOUR_JENKINS_URL%/jobs/boost-1.59.0-osx1010-ac610-x86_64/config.xml How does it look like?
  
Cheers

Simon Haegler

unread,
Sep 15, 2015, 7:25:21 AM9/15/15
to Jenkins Users
  - Can you check your config.xml file? %YOUR_JENKINS_URL%/jobs/boost-1.59.0-osx1010-ac610-x86_64/config.xml How does it look like?

doh, thanks for reminding me to check the actual XML ;-)
interestingly, the groovy build step is actually created in the XML, but not displayed by the job UI:
...
<builders>
    <hudson.plugins.groovy.Groovy>
        <!-- this step does NOT show up in the UI -->
        <groovyName>groovy-2.4.4</groovyName>
        <parameters/>
        <scriptParameters/>
        <javaOpts/>
        <classPath>${WORKSPACE}/build_support.git/thirdparty</classPath>
        <scriptSource class="hudson.plugins.groovy.FileScriptSource">
            <scriptFile>${WORKSPACE}/build_support.git/thirdparty/boost/boost-1.59.0-build.groovy</scriptFile>
        </scriptSource>
        <properties/>
    </hudson.plugins.groovy.Groovy>
    <hudson.tasks.Maven>
        <!-- this step shows up in the UI -->
        </hudson.tasks.Maven>
</builders>
...


i increased the log verbosity but could not (yet) spot any issues during configuration page loading... i'll keep trying.

best,
simon

Daniel Beck

unread,
Sep 15, 2015, 7:58:30 AM9/15/15
to jenkins...@googlegroups.com
Anything interesting in Old Data Monitor saying something cannot be loaded?
> --
> 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/0c621590-feca-45fc-9788-448be8145ec1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Simon Haegler

unread,
Sep 15, 2015, 9:19:07 AM9/15/15
to Jenkins Users, m...@beckweb.net
On Tuesday, 15 September 2015 13:58:30 UTC+2, Daniel Beck wrote:
Anything interesting in Old Data Monitor saying something cannot be loaded?

nope, the ODM is empty.

best,
simon

Slide

unread,
Sep 15, 2015, 9:41:00 AM9/15/15
to Jenkins Users, m...@beckweb.net
I find it is easier to debug these issues if you go in and create a normal Free Style Job with a groovy step and all the parameters that you want and then look at the XML that is created when you save the job. Then you can compare something that works to what is being generated by job dsl.

--
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.
Reply all
Reply to author
Forward
0 new messages