1.环境说明

  操作系统:win7旗舰版64bit

  jdk:sun JDK1.7.0_80 64bit

  tomcat:apache-tomcat-8.0.41

  jenkins:2.32.3LST

本系列教程如果没有特殊说明,都会默认采用此环境。

2.定时构建的写法

  勾选『Poll SCM』,点击输入框右边的帮助图标:

弹出的内容中详细解释了定时构建的用法,并给出了几个例子:

This field follows the syntax of cron (with minor differences). Specifically, each line consists of  fields separated by TAB or whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (–)
HOUR The hour of the day (–)
DOM The day of the month (–)
MONTH The month (–)
DOW The day of the week (–) where and are Sunday.
To specify multiple values for one field, the following operators are available. In the order of precedence, * specifies all valid values
M-N specifies a range of values
M-N/X or */X steps by intervals of X through the specified range or whole valid range
A,B,...,Z enumerates multiple values
To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. For example, using * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not all at the same time, better using limited resources. The H symbol can be used with a range. For example, H H(-) * * * means some time between : AM (midnight) to : AM. You can also use step intervals with H, with or without ranges. The H symbol can be thought of as a random value over a range, but it actually is a hash of the job name, not a random function, so that the value remains stable for any given project. Beware that for the day of month field, short cycles such as */ or H/ will not work consistently near the end of most months, due to variable month lengths. For example, */ will run on the 1st, 4th, …31st days of a long month, then again the next day of the next month. Hashes are always chosen in the - range, so H/ will produce a gap between runs of between and days at the end of a month. (Longer cycles will also have inconsistent lengths but the effect may be relatively less noticeable.) Empty lines and lines that start with # will be ignored as comments. 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 : AM and : AM. Examples: # every fifteen minutes (perhaps at :, :, :, :)
H/ * * * *
# every ten minutes in the first half of every hour (three times, perhaps at :, :, :)
H(-)/ * * * *
# once every two hours at minutes past the hour starting at : AM and finishing at : PM every weekday.
-/ * * -
# once in every two hours slot between AM and PM every weekday (perhaps at : AM, : PM, : PM, : PM)
H H(-)/ * * -
# once a day on the 1st and 15th of every month except December

3.示例

在22:21新建的项目,希望在22:22触发构建。

Jenkins系列——定时构建的更多相关文章

  1. 【Jenkins】定时构建语法

    跟cron定时任务语法基本类似 一.字段有哪些 每行包含5个字段,用制表符或空格隔开,从左至右依次是: 分 时 天 月 星期 二.每个字段的取值范围 分钟 (0–59) 时 (0–23) 天 (1–3 ...

  2. Jenkins配置定时构建项目

    general: 源码管理: 构建触发器: 构建后操作:

  3. Jenkins之定时构建

    参考文章:https://blog.csdn.net/ZZY1078689276/article/details/77520441 第一个*表示分钟,取值0~59 第二个*表示小时,取值0~23 第三 ...

  4. Jenkins环境搭建(4)-配置定时构建

    每次手动触发job构建,是很麻烦的一件事情,job中可以配置定时构建,今天就来分享下定时构建:构建分为两种:定时构建和轮询SCM. 一.定时构建 Jenkins采用了著名的UNIX任务调度工具CRON ...

  5. Jenkins 定时构建语法规则

    1.Jenkins自由风格任务定时构建 2.语法规则 定时构建语法 * * * * * 第一个*表示分钟,取值0~59 第二个*表示小时,取值0~23 第三个*表示一个月的第几天,取值1~31 第四个 ...

  6. jenkins持续集成:定时构建语法

    构建位置:选择或创建工程_设置_构建触发器 1. 定时构建语法:* * * * * (五颗星,多个时间点,中间用逗号隔开)第一个*表示分钟,取值0~59第二个*表示小时,取值0~23第三个*表示一个月 ...

  7. git+jenkins持续集成三-定时构建语法

    构建位置:选择或创建工程_设置_构建触发器 1. 定时构建语法:* * * * * (五颗星,多个时间点,中间用逗号隔开)第一个*表示分钟,取值0~59第二个*表示小时,取值0~23第三个*表示一个月 ...

  8. git+jenkins持续集成二-jenkins定时构建语法:定时构建语法

    构建位置:选择或创建工程_设置_构建触发器 1. 定时构建语法:* * * * * (五颗星,多个时间点,中间用逗号隔开)第一个*表示分钟,取值0~59第二个*表示小时,取值0~23第三个*表示一个月 ...

  9. Jenkins系列之-—06 Ant构建

    一.Ant 简介&构建环境 Apache Ant 是由 Java 语言开发的工具 构建ant环境: 1). 安装jdk,设置JAVA_HOME ,PATH ,CLASS_PATH 2). 下载 ...

随机推荐

  1. linux_NFS

    NFS是什么? 网络文件系统,又叫共享存储,通过网络连接让不同主机之间实现共享存储. 应用于存放图片.附件.视频等用户上传文件 相关同类应用:大型网站nfs有压力,使用moosefs(mfs),Ghu ...

  2. python_如何实现可迭代对象和迭代器对象?

    什么是可迭代对象? 列表.字符串 for循环的本质? for循环要确保in后面的对象为可迭代对象,如何确保? iter() 方法得到一个迭代器对象 不停.__next__() 方法对迭代器对象进行迭代 ...

  3. JavaScript 教程:对象

    JavaScript 对象是拥有属性和方法的数据.学过编程语言的都知道,此处不再详述! 1.对象的定义: <script> </script> 对象也可以先创建,再添加属性和属 ...

  4. 流API--缩减操作

    在Stream流操作中,比如说min(),max(),count()方法,这几个操作都会将一个流缩减成一个值,流API将这些操作称为特例缩减.另外,流API同时泛华了缩减这种概念,提供了reduce( ...

  5. Web Application和Web Site两个模板的比较

    Scenario Web Application Project Web Site Project 项目定义 跟 Visual Studio .NET 2003 类似,由于项目文件的存在,只有被项目文 ...

  6. func_get_args  获取一个函数的所有参数

    func_get_args  获取一个函数的所有参数 {     $numargs = func_num_args(); //参数数量     echo "参数个数是: $numargs&l ...

  7. 最全 Linux 磁盘管理基础知识全汇总

    一.存储设备的挂载和卸载 存储设备的挂载和卸载常用操作命令:fdisk  -l.df.du.mount.umount. fdisk  -l 命令 1.作用 查看所有硬盘的分区信息,包括没有挂上的分区和 ...

  8. _beginthread和CreatThread的区别

    转自:http://www.jb51.net/article/41459.htm 我们知道在Windows下创建一个线程的方法有两种,一种就是调用Windows API CreateThread()来 ...

  9. 接口中定义变量必须为public static final的原因

    在interface里面的变量默认都是public static final 的,原因如下: 1.   接口是一种高度抽象的"模版",,而接口中的属性也就是’模版’的成员,就应当是 ...

  10. ABP官方文档翻译 6.3 本地化

    本地化 介绍 应用程序语言 本地化源 XML文件 注册XML本地化源 JSON文件 注册JSON本地化源 资源文件 自定义源 当前语言是如何决定的 ASP.NET Core ASP.NET MVC 5 ...