我使用CruiseControl.NET使用Git。我配置了两个项目,每个项目针对同一个存储库中的不同分支。我为每个项目配置了一个用于buildCondition =“IfModificationExists”的intervalTrigger。问题是,只要存储库中的任何分支上存在更改,而不是仅为为项目配置的分支上的版本,该版本就会同时运行这两个项目。在CruiseControl.NET,当buildCondition =“IfModificationExists”构建是通过改变任何分支触发,不更改配置的分支
更具体而言,我已配置了两个CCNET项目,ProductionCI和ReleaseCandidateCI用于各个分支生产和ReleaseCandidate。当我将更改合并到分支ReleaseCandidate时,项目ReleaseCandidateCI按预期构建。但是,即使生产分支上没有任何更改,项目ProductCI也是如此。
这是大多只是一个烦恼,因为每一个项目执行每它所需的时间。当它没用时,它们也会执行。
这里是我的配置:
文件trigger.xml
<cb:config-template xmlns:cb="urn:ccnet.config.builder">
<triggers>
<intervalTrigger
name="continuous"
seconds="600"
buildCondition="IfModificationExists"
initialSeconds="5"/>
</triggers>
</cb:config-template>
文件的ccnet.config
<project>
<name>ProductionCI</name>
...
<cb:include href="trigger.xml" xmlns:cb="urn:ccnet.config.builder"/>
...
<sourcecontrol type="multi">
<sourceControls>
<git>
<repository>[url to repo]</repository>
<branch>Production</branch>
<workingDirectory>[path to directory]</workingDirectory>
<autoGetSource>true</autoGetSource>
</git>
</sourceControls>
</sourcecontrol>
...
</project>
<project>
<name>ReleaseCandidateCI</name>
...
<cb:include href="trigger.xml" xmlns:cb="urn:ccnet.config.builder"/>
...
<sourcecontrol type="multi">
<sourceControls>
<git>
<repository>[url to repo]</repository>
<branch>ReleaseCandidate</branch>
<workingDirectory>[path to directory]</workingDirectory>
<autoGetSource>true</autoGetSource>
</git>
</sourceControls>
</sourcecontrol>
...
</project>
注:据我所知,使用单独的存储库,而不是分支机构将解决这个问题,但这不是一个真正的选择。
在此先感谢您的帮助。
如果您在一个项目下将您的分支的构建作业合并在一起,并用两个''块替换''会怎样? –
感谢您的评论。设置sourcecontrol type =“git”会导致pull失败。当我最初设置项目时,我遇到了这个问题。根据文件,它必须设置为“多”http://cruisecontrolnet.org/projects/ccnet/wiki/Multi_Source_Control。并且将构建项目组合起来不会做我想做的,只有在生产或ReleaseCandidate分支发生更改时才构建它们。 –
你使用什么CC.NEt版本? – TridenT