Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在CruiseControl.Net中为一个项目配置两个不同的触发器?_Cruisecontrol.net - Fatal编程技术网

如何在CruiseControl.Net中为一个项目配置两个不同的触发器?

如何在CruiseControl.Net中为一个项目配置两个不同的触发器?,cruisecontrol.net,Cruisecontrol.net,我想知道是否可以在同一个配置文件中创建两个触发器,一个在文件系统上,另一个用于svn签出。 我尝试了以下方法: a) 将触发器及其各自的文件系统、svn定义以及任务放在同一个文件中, 结果出错:它表示未使用的节点已被删除 例如: ... .... ... …\SVN.exe .. b) 已经为每个触发器创建了不同的作用域,这些触发器与各自的文件系统/svn和任务绑定在一起,最后还检测到未使用的节点错误 <cb:define first_trigger_and source _and_t

我想知道是否可以在同一个配置文件中创建两个触发器,一个在文件系统上,另一个用于svn签出。 我尝试了以下方法:

a) 将触发器及其各自的文件系统、svn定义以及任务放在同一个文件中, 结果出错:它表示未使用的节点已被删除 例如:


...
....
...
…\SVN.exe
..
b) 已经为每个触发器创建了不同的作用域,这些触发器与各自的文件系统/svn和任务绑定在一起,最后还检测到未使用的节点错误

<cb:define first_trigger_and source _and_tasks>
 <triggers>
  <intervalTrigger seconds="300" buildCondition="ForceBuild"/> 
 </triggers>
 <sourcecontrol type="filesystem">
   <repositoryRoot>...</repositoryRoot>
 </sourcecontrol>
 <tasks>
  <!--To be carried out when first trigger happens -->
 </tasks>
</cb:define>

<!-- And then I call the trigger this way -->
<cb:first_trigger_and source _and_tasks>

...

这两种解决方案都不起作用。

可以在
块内指定多个触发器,但这不是CruiseControl.Net在处理配置时抱怨的原因

在我看来,您需要一个触发器,但需要两个独立的源代码管理条目。这些条目指定CruiseControl.Net应在何时唤醒并检查项目状态。不能在
块中指定多个
元素。要在(远程)svn更改和本地文件系统更改上实际重建项目,应使用标准触发器:

<triggers>
  <intervalTrigger seconds="30" />
</triggers>

<sourcecontrol type="multi">
  <sourceControls>
    <filesystem>
      <repositoryRoot>...</repositoryRoot>
    </filesystem>    
    <svn>
      <trunkUrl>....</trunkUrl>
      <workingDirectory>...</workingDirectory>
      <executable>...\SVN.exe</executable>
      <username/>..<password/>
    </svn>
  </sourceControls>
</sourcecontrol>

<tasks>
 <!-- To be executed if either of the two source control providers report changes -->
</tasks>

...
....
...
…\SVN.exe
..

非常感谢,这很有效。我一直试图在一个项目文件中添加两个触发器源,是的,这个代码块正好完成了这一点。:)
<triggers>
  <intervalTrigger seconds="30" />
</triggers>

<sourcecontrol type="multi">
  <sourceControls>
    <filesystem>
      <repositoryRoot>...</repositoryRoot>
    </filesystem>    
    <svn>
      <trunkUrl>....</trunkUrl>
      <workingDirectory>...</workingDirectory>
      <executable>...\SVN.exe</executable>
      <username/>..<password/>
    </svn>
  </sourceControls>
</sourcecontrol>

<tasks>
 <!-- To be executed if either of the two source control providers report changes -->
</tasks>