perBuildTag

212 views
Skip to first unread message

Jeff Winnett

unread,
Oct 7, 2016, 11:50:42 AM10/7/16
to job-dsl-plugin

Using Job DSL I can create a very basic Jenkins job that pulls my code out of my Github Enterprise repo, but the Job DSL ‘perBuildTag()’ method defaults to true so that the Jenkins job always attempts to write a tag to the GHE repo every time the newly built Jenkins job runs (Additional Behaviors:  Create a tag for every build).  I don’t want to write a tag to the repo on every build.  Any ideas how to turn this perBuildTag() off in code?  I've tried using 'createTag(false) like I saw in another similar post thread, but this doesn't seem to do anything, either.

Thanks.

Victor Martinez

unread,
Oct 7, 2016, 6:11:27 PM10/7/16
to job-dsl-plugin
Hi Jeff,

I used to disable that feature by using your suggested flag as you can see in below JobDSL snippet:

job('yyyyy') {
      ...
    scm {
        git {
            remote {
                name('remote')
                url ('xxx')
            }
            branch('master')
            createTag false
        }
    }
    ...
}

But I'm based on 1.44

If you are based on the latest one or version above 1.46 then you could use: https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL

Cheers

Jeff Winnett

unread,
Oct 10, 2016, 12:53:52 PM10/10/16
to job-dsl-plugin
I finally got it working.  Here’s what I finally ended up having to do to prevent the generated job from specifying that a tag be created in the GHE repo every build.  The key seems to be the empty ‘extensions’ block.

 

job (projectName) {

  scm {

    git {

      remote {

        name('remote');

        url("url");

      }

      branch(branchName);

      extensions {

Daniel Spilker

unread,
Oct 10, 2016, 2:37:49 PM10/10/16
to job-dsl...@googlegroups.com
Which version of Job DSL are you using? In recent versions an empty extensions block makes no difference to the generated config XML. You can test that with the playground: http://job-dsl.herokuapp.com/

Daniel


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/648be55d-23c7-4b55-86e6-3d0732c6898e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marc Esher

unread,
Jun 28, 2017, 12:29:40 PM6/28/17
to job-dsl-plugin
Hey all,

I wanted to let you know about how this perBuildTag behavior had an unexpected consequence for us. Long story short: we didn't know that a lot of our jobs were creating a tag per build since we usually use the simple git() DSL (our bad for not knowing), and it turns out we have some jobs that run very frequently and ultimately had resulted in creating tens of thousands of git tags in the workspace (because we don't do periodic workspace cleaning... which we'll now start to do). Anyways, this ended up causing problems because our antivirus software was scanning those tags on every jenkins job run, and it resulted in AV sucking up a lot of CPU and causing slowness in other jobs. Good times!

Over the next few days we'll be modifying all our job-dsl based jobs to not use the simple DSL, to solve this problem.

For those of you who like stories about troubleshooting, I wrote about it at https://marcesher.com/2017/06/27/the-curious-case-of-the-slow-jenkins-job/

Marc


On Monday, October 10, 2016 at 2:37:49 PM UTC-4, Daniel Spilker wrote:
Which version of Job DSL are you using? In recent versions an empty extensions block makes no difference to the generated config XML. You can test that with the playground: http://job-dsl.herokuapp.com/

Daniel

On Mon, Oct 10, 2016 at 6:53 PM, Jeff Winnett <winne...@gmail.com> wrote:
I finally got it working.  Here’s what I finally ended up having to do to prevent the generated job from specifying that a tag be created in the GHE repo every build.  The key seems to be the empty ‘extensions’ block.

 

job (projectName) {

  scm {

    git {

      remote {

        name('remote');

        url("url");

      }

      branch(branchName);

      extensions {

      }           

    }

  }

}


On Friday, October 7, 2016 at 8:50:42 AM UTC-7, Jeff Winnett wrote:

Using Job DSL I can create a very basic Jenkins job that pulls my code out of my Github Enterprise repo, but the Job DSL ‘perBuildTag()’ method defaults to true so that the Jenkins job always attempts to write a tag to the GHE repo every time the newly built Jenkins job runs (Additional Behaviors:  Create a tag for every build).  I don’t want to write a tag to the repo on every build.  Any ideas how to turn this perBuildTag() off in code?  I've tried using 'createTag(false) like I saw in another similar post thread, but this doesn't seem to do anything, either.

Thanks.

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