Skip to content

Instantly share code, notes, and snippets.

@rodrigozrusso
Created February 18, 2015 07:58
Show Gist options
  • Save rodrigozrusso/3d7e31de720b2d0df006 to your computer and use it in GitHub Desktop.
Save rodrigozrusso/3d7e31de720b2d0df006 to your computer and use it in GitHub Desktop.
Create jenkins job based on template (groovy)
def jenkins = hudson.model.Hudson.instance
def template = jenkins.getItem("MyTemplate")
def job = jenkins.copy(template,"MyNewJob")
job.scm = new hudson.scm.SubversionSCM("http://base/branches/mybranche")
job.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment