Jenkins - 每月或每周构建工作

Jenkins - Build job monthly or weekly

安排 Jenkins 作业的 cron 语法是什么:

a) 每月 b) 每周

谢谢!

Jenkins 在这里提供了有用的概述。如果在作业配置中勾选 定期构建,则可以单击 Schedule.

旁边的问号

我只想引用其中的一小部分(自己阅读整个帮助总是有帮助的):

This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5 fields separated by TAB or whitespace:

MINUTE HOUR DOM MONTH DOW

MINUTE Minutes within the hour (0–59)
HOUR   The hour of the day (0–23)
DOM    The day of the month (1–31)
MONTH  The month (1–12)
DOW    The day of the week (0–7) where 0 and 7 are Sunday.

[...]

In addition, @yearly, @annually, @monthly, @weekly, @daily, @midnight, and @hourly are supported as convenient aliases. These use the hash system for automatic balancing. For example, @hourly is the same as H * * * * and could mean at any time during the hour. @midnight actually means some time between 12:00 AM and 2:59 AM.

Jenkins 还支持预定义的别名来安排构建:

@hourly、@daily、@weekly、@monthly、@midnight

@hourly --> 每小时开始构建 --> 0 * * * *

@daily, @midnight --> 每天午夜构建 --> 0 0 * * *

@weekly --> 每周日午夜构建 --> 0 0 * * 0

@monthly --> 每月第一天午夜构建 --> 0 0 1 * *

每周我成功使用:H 0 * * 0