Configure or Create hudson job automatically

前端 未结 7 536
猫巷女王i
猫巷女王i 2020-12-11 14:44

Is there any way to create new Hudson job by one more Hudson job based one previous Jobs?

For example if I need to create new bunch of jobs one by one, Automatically

7条回答
  •  醉酒成梦
    2020-12-11 15:28

    You could use groovy system script like this :

    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()
    

提交回复
热议问题