PrePostClean with DSL crating issues

19 views
Skip to first unread message

Samuel Lopez

unread,
Jul 18, 2016, 6:32:41 PM7/18/16
to job-dsl-plugin
Hello Folks,

Jenkins: 2.7.1
OS: Ubuntu 14.04

I am trying to add the following block

        configure { project ->
    project / buildWrappers << 'de.jamba.hudson.plugin.wsclean.PrePostClean'(plugin: 'hudson-wsc...@1.0.5') {
        before('false')
        behind('true')
      }
         }

to a job generated by DSL the step gets added the job as expected.

But when the job runs it seems to be  running the PrePostClean right after the build step and on the machine were the build is being done.

It is only supposed to clean only on other nodes were the build has run and not on the  current system.

When I add the step  manually things work as expected.

The difference appeared to be that when I configure the job manually all of the steps prior to build environment get wrap in in the 'properties' tag and  the PrePostClean step is at the bottom
of the  job config by itself as follows: 

  </publishers>
  <buildWrappers>
    <de.jamba.hudson.plugin.wsclean.PrePostClean plugin="hudson-wsc...@1.0.5">
      <before>false</before>
      <behind>true</behind>
    </de.jamba.hudson.plugin.wsclean.PrePostClean>
  </buildWrappers>
</project>

When I run the  job update via DSL

There are other components  mingled in the buildWrappers section.

    <buildWrappers>
        <de.jamba.hudson.plugin.wsclean.PrePostClean plugin="hudson-wsc...@1.0.5">
            <before>false</before>
            <behind>true</behind>
        </de.jamba.hudson.plugin.wsclean.PrePostClean>
    </buildWrappers>
    <assignedNode>sjc-prd-lrls30</assignedNode>
    <logRotator>
        <daysToKeep>60</daysToKeep>
        <numToKeep>-1</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
    </logRotator>
    <scm class="hudson.plugins.mercurial.MercurialSCM">
        <source>ssh://merc//home/hg/CouponsComWeb/PaiWeb</source>
        <modules/>
        <revisionType>BRANCH</revisionType>
        <revision>1.56-release</revision>
        <clean>true</clean>
        <credentialsId/>
        <disableChangeLog/>
        <credentials/>
        <browser class="hudson.plugins.mercurial.browser.HgWeb">
            <url>http://merc/index.cgi/CouponsComWeb/PaiWeb/</url>
        </browser>
    </scm>

Does anyone know what am I missing/doign wrong?

Thank you kindly.

Sam

CleanUpAllWorspaces.PNG

Daniel Spilker

unread,
Aug 9, 2016, 2:46:40 AM8/9/16
to job-dsl...@googlegroups.com
The order of the elements within the <project> tag does not matter and your configure block seems to be correct. I have never used that plugin, so I have no experience with it's behavior. Are the other job config settings correct, e.g. the label?

Daniel

On Tue, Jul 19, 2016 at 12:32 AM, Samuel Lopez <lope...@gmail.com> wrote:
Hello Folks,

Jenkins: 2.7.1
OS: Ubuntu 14.04

I am trying to add the following block

        configure { project ->
    project / buildWrappers << 'de.jamba.hudson.plugin.wsclean.PrePostClean'(plugin: 'hudson-wsc...@1.0.5') {
        before('false')
        behind('true')
      }
         }

to a job generated by DSL the step gets added the job as expected.

But when the job runs it seems to be  running the PrePostClean right after the build step and on the machine were the build is being done.

It is only supposed to clean only on other nodes were the build has run and not on the  current system.

When I add the step  manually things work as expected.

The difference appeared to be that when I configure the job manually all of the steps prior to build environment get wrap in in the 'properties' tag and  the PrePostClean step is at the bottom
of the  job config by itself as follows: 

  </publishers>
  <buildWrappers>
    <de.jamba.hudson.plugin.wsclean.PrePostClean plugin="hudson-wsclean-plugin@1.0.5">
      <before>false</before>
      <behind>true</behind>
    </de.jamba.hudson.plugin.wsclean.PrePostClean>
  </buildWrappers>
</project>

When I run the  job update via DSL

There are other components  mingled in the buildWrappers section.

    <buildWrappers>
        <de.jamba.hudson.plugin.wsclean.PrePostClean plugin="hudson-wsclean-plugin@1.0.5">

--
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-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/ff833694-8083-4760-a7dd-9579fda2e1e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages