Publish over CIFS via Configure block ("publishers" node causes trouble)

145 views
Skip to first unread message

Arno Moonen

unread,
Dec 22, 2016, 2:54:45 AM12/22/16
to job-dsl-plugin
I'm trying to configure the Publish over CIFS via the configure block in Job DSL.
Unfortunately, it contains a node called "publishers" that is causing problems.

The XML looks like this (within the publishers node of a project):
<jenkins.plugins.publish__over__cifs.CifsPublisherPlugin plugin="publish-over-cifs@0.3">
   
<consolePrefix>CIFS:</consolePrefix>
   
<delegate>
       
<publishers>
           
<jenkins.plugins.publish__over__cifs.CifsPublisher>
               
<configName>Some Network Share</configName>
               
<verbose>false</verbose>
               
<transfers>
                   
<jenkins.plugins.publish__over__cifs.CifsTransfer>
                       
<remoteDirectory>${JOB_BASE_NAME}</remoteDirectory>
                       
<sourceFiles>app/bin/Release/**</sourceFiles>
                       
<excludes>**/*.pdb **/*.vshost.ex* *.xml</excludes>
                       
<removePrefix>app/bin/Release</removePrefix>
                       
<remoteDirectorySDF>false</remoteDirectorySDF>
                       
<flatten>false</flatten>
                       
<cleanRemote>true</cleanRemote>
                       
<noDefaultExcludes>false</noDefaultExcludes>
                       
<makeEmptyDirs>false</makeEmptyDirs>
                       
<patternSeparator>[, ]+</patternSeparator>
                   
</jenkins.plugins.publish__over__cifs.CifsTransfer>
               
</transfers>
               
<useWorkspaceInPromotion>false</useWorkspaceInPromotion>
               
<usePromotionTimestamp>false</usePromotionTimestamp>
           
</jenkins.plugins.publish__over__cifs.CifsPublisher>
       
</publishers>
       
<continueOnError>false</continueOnError>
       
<failOnError>false</failOnError>
       
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
       
<hostConfigurationAccess class="jenkins.plugins.publish_over_cifs.CifsPublisherPlugin" reference="../.." />
   
</delegate>
</jenkins.plugins.publish__over__cifs.CifsPublisherPlugin>


So, I started writing this Job DSL in the Playground:
freeStyleJob('Utility Name') {
     
    configure
{ project ->


       
// Configure Publish over CIFS
        project
/ publishers / 'jenkins.plugins.publish__over__cifs.CifsPublisherPlugin'(plugin: 'publish-over-cifs@0.3') {
 consolePrefix
'CIFS:'
           
delegate {
                continueOnError
'false'
                failOnError
'false'
                alwaysPublishFromMaster
'false'
                publishers
{
                   
'jenkins.plugins.publish__over__cifs.CifsPublisher' {
                        configName
'Some Network Share'
                        verbose
'false'
                        useWorkspaceInPromotion
'false'
                   
}
               
}
           
}
       
}
   
}  
}


But this throws a java.util.ConcurrentModificationException. Further experiments tell me that this is because of the publishers node within the delegate node.
If I change it to 'publishers ' (so, quoted and with additional whitespace), it does seem to generate the XML (but with an unnecessary space).
Is this the only workaround for this problem, or is there an actual way to solve this?

Note that I have looked at Automatically Generated DSL, but since I want the developers to be able to test their scripts locally, this isn't a real solution for me.

Kind regards,
Arno Moonen

Fiouz

unread,
Dec 22, 2016, 3:14:29 AM12/22/16
to job-dsl-plugin

Does it work with delegate.publishers ? Notice that is not the "delegate" XML node, but the Groovy closure delegate used to avoid collision with outer scope.


--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/d20872ba-8267-464e-aca2-aadc44572a9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

--
Fiouz

Arno Moonen

unread,
Dec 22, 2016, 3:27:40 AM12/22/16
to job-dsl-plugin
Thanks. That does work.

-Arno

Op donderdag 22 december 2016 09:14:29 UTC+1 schreef Shoy Ronugea:
Reply all
Reply to author
Forward
0 new messages