How to reload hudson configuration without restarting?

后端 未结 4 1696
一个人的身影
一个人的身影 2020-12-03 20:57

I have a large task ahead of me...modifying several hudson jobs\' configuration. What I would want is to do it from command line. But per my experience, hudson will not re-r

4条回答
  •  一整个雨季
    2020-12-03 21:32

    Extending on the idea of Andreas Panagiotidis, there's now a simpler and cleaner way to reload the configuration of a single Item

    import jenkins.model.Jenkins;
    
    def job_path = 'folder1/folder2/job_name'
    
    Jenkins j = Jenkins.get()
    
    def job = j.getItemByFullName(job_path)
    
    if (job) {
      job.doReload()
    }
    

    Note that the path may simply be 'job_name'.

提交回复
热议问题