P Solomon
P Solomon

Reputation: 175

Jenkins Job DSL always creates a git tag for freestyle jobs using the git plugin

I am creating a freestyle job with the Jenkins Job DSL. It appears to create a git tag every time. The default for scm -> git -> createTag appears to be "false", but this is deprecated. Was this turned ON elsewhere?

My code snippet is as follows (I added the createTag line to try to fix it, but it creates the add tag in "additional behaviors" anyway). Suggestions on how to fix?

scm {
  git(buildRepoName, branchName) {
    createTag(false)
  }
}

Upvotes: 2

Views: 972

Answers (1)

daspilker
daspilker

Reputation: 8194

If you use the git method with a closure parameter, the "create tag" option is disabled by default. See the API Viewer for details. See also JENKINS-33482.

job('example') {
  scm {
    git {
      remote {
        url('https://github.com/jenkinsci/job-dsl-plugin.git')
      }
      branch('master')
    }
  }
}

Upvotes: 2

Related Questions