0

我配置了以下触发器,以便成功构建项目 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>

但是,我真正想要的是只有在项目 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>

还有另一种方法可以实现这一目标吗?

4

1 回答 1

1

CC.net 似乎没有提供否定触发逻辑的方法。可以理解,考虑到触发器告诉 CC.net 何时执行源代码控制块(检查修改)并开始集成。但是,您可以使用带有 的sourcecontroltype="external",它允许您使用自己的可执行文件来决定是否开始集成。

有时我还使用文件系统源代码控制块在某个文件更改时开始集成。例如当c:\onsuccess\success.txt用于表示成功时,已更新。

<sourcecontrol type="filesystem">
   <repositoryRoot>c:\onsuccess</repositoryRoot>
   <ignoreMissingRoot>true</ignoreMissingRoot>
 </sourcecontrol>

附录相关文档的链接

于 2012-12-10T14:31:50.930 回答