我配置了以下触发器,以便成功构建项目A或项目B将触发此项目(C):
<triggers>
<multiTrigger operator="And">
<triggers>
<multiTrigger operator="Or">
<triggers>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="A" >
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="B">
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
</triggers>
</multiTrigger>
<scheduleTrigger time="20:30" buildCondition="ForceBuild">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
</multiTrigger>
</triggers>
然而,我真正想要的是只有在BOTH项目A和B的最后一次构建成功时才构建项目C.我认为以下内容可行,但似乎没有任何方法可以逻辑反转projectTrigger。
<triggers>
<multiTrigger operator="And">
<triggers>
<multiTrigger operator="Or">
<triggers>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="A" >
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="B">
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>Success</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
</triggers>
</multiTrigger>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="A" >
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>NotFailure</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
<projectTrigger serverUri="tcp://localhost:21235/CruiseManager.rem" project="B">
<triggerFirstTime>False</triggerFirstTime>
<triggerStatus>NotFailure</triggerStatus>
<innerTrigger type="intervalTrigger" seconds="60" buildCondition="ForceBuild" />
</projectTrigger>
<scheduleTrigger time="20:30" buildCondition="ForceBuild">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
</multiTrigger>
</triggers>
还有另一种方法可以达到这个目的吗?
答案 0 :(得分:1)
CC.net似乎没有提供一种否定触发逻辑的方法。可以理解,考虑到触发器告诉CC.net何时执行源控制块(检查修改)并开始集成。但是,您可以使用带有 sourcecontrol
的 type="external"
块,它允许您使用自己的可执行文件来决定是否开始集成。< / p>
有时我还使用文件系统源控制块在某个文件发生更改时启动集成。例如,当c:\onsuccess\success.txt
用于表示成功时,已更新。
<sourcecontrol type="filesystem">
<repositoryRoot>c:\onsuccess</repositoryRoot>
<ignoreMissingRoot>true</ignoreMissingRoot>
</sourcecontrol>
附录:链接到relevant documentation