这块配置在什么情况下运行集成
通常你会用Interval trigger,就是每个多长时间运行一次集成,Schedule trigger也是经常使用的,Filter Trigger是在某种情况下组织集成的运行(比如你正在进行备份),你也可以制定一个空的节点<triggers/>只能手动执行。
有如下几种:
- Filter Trigger
- Interval Trigger
- Multiple Trigger
- Project Trigger
- Schedule Trigger
- Url Trigger
1. Interval Trigger
每隔一段时间执行一次集成
< intervalTrigger name ="continuous" seconds ="30" buildCondition ="ForceBuild" />name: trigger的名字,可以随便起,
seconds: 两次集成的时间间隔
buildCondition: IfModificationExists,只有源码有修改才运行
ForceBuild,不管有无修改都运行
2. Schedule Trigger
< scheduleTrigger time ="23:30" buildCondition ="ForceBuild" >
< weekDays >
< weekDay > Monday </ weekDay >
</ weekDays >
</ scheduleTrigger >time:什么时间执行,buildCondition同上, weekDays是和集合Monday-Sunday,哪天执行。
3. Filter Trigger
什么时间,什么类型的Trigger不执行
< filterTrigger startTime ="23:30" endTime ="23:45" >
< trigger type ="intervalTrigger" seconds ="60" />
< weekDays >
< weekDay > Sunday </ weekDay >
</ weekDays >
</ filterTrigger >
4.Multiple Trigger
多个Trigger,operator如果是And那么任何一个Trigger没有执行,集成都不执行。可选值是And 和Or< multiTrigger operator ="And" >
< triggers >
< intervalTrigger />
< filteredTrigger startTime ="23:30" endTime ="23:45" />
</ triggers >
</ multiTrigger >
5.Project Trigger
由别的项目引起集成
< projectTrigger serverUri ="tcp://server:21234/CruiseManager.rem" project ="Server" >
< triggerStatus > Success </ triggerStatus >
< innerTrigger type ="intervalTrigger" seconds ="30" buildCondition ="ForceBuild" />
</ projectTrigger >triggerStatus:引起集成的条件,可能的值有 Success, Failure, Exception and Unknown
6. Url Trigger
有制定的Url文件修改引起的集成,buildCondition可设为默认IfModificationExists< urlTrigger url ="http://server/page.html" seconds ="30" buildCondition ="ForceBuild" />