I want Jenkins job to build every two weeks

后端 未结 4 1932
悲哀的现实
悲哀的现实 2020-12-18 00:12

Will this expression run the build every other Friday at noon? Assume i set this up on a Friday?

0 12 * * */14

I tried 0 12 * * FRI/14 but Jenkins returned a

4条回答
  •  悲&欢浪女
    2020-12-18 00:59

    I had the same issue, the easy work around I found was to create another job that run weekly.
    This job was a simple groovy script that does the following:

    import jenkins.model.*;
    def job = Jenkins.instance.getJob('JobNameToRunEveryTwoWeek')
    job.setDisabled(!job.isDisabled())
    

    Since Jenkins does not offer the functionnality its the best easy solution I could find. If you have better solution feel free to let me know.

提交回复
热议问题