我正在使用CruiseControl.Net并尝试采用干法,如文章http://www.zorched.net/2009/01/30/dry-your-cruisecontrolnet-configuration/所示。我有一个简单的ccnet.config和一个简单的项目文件Test-project.xml。配置评估工具告诉我“检测到重复节点”。任何线索/提示都会很棒。
的ccnet.config
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- Standard Inits -->
<cb:define name="StandardInit-block">
<webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&server=local&project=Introvert</webURL>
<artifactDirectory>D:\CC\$(ProjName)\artifact\</artifactDirectory>
<modificationDelaySeconds>120</modificationDelaySeconds>
</cb:define>
<!-- Trigger run weekly -->
<!-- Vars $(TriggerTime), $(ProjName) -->
<cb:define name="WeeklyBuild-block">
<triggers>
<scheduleTrigger time="$(TriggerTime)" buildCondition="ForceBuild" name="Nightly build at $(TriggerTime) for $(ProjName)">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
</cb:define>
<cb:include href="Test-project.xml" xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- Standard Inits -->
<cb:define name="StandardInit-block">
<webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&server=local&project=Introvert</webURL>
<artifactDirectory>D:\CC\$(ProjName)\artifact\</artifactDirectory>
<modificationDelaySeconds>120</modificationDelaySeconds>
</cb:define>
<!-- Trigger run weekly -->
<!-- Vars $(TriggerTime), $(ProjName) -->
<cb:define name="WeeklyBuild-block">
<triggers>
<scheduleTrigger time="$(TriggerTime)" buildCondition="ForceBuild" name="Nightly build at $(TriggerTime) for $(ProjName)">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
</cb:define>
<cb:include href="Test-project.xml" xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>
试验project.xml中
<project name="Test" xmlns:cb="urn:ccnet.config.builder">
<cb:scope
TriggerTime="2:30"
ProjName="Test"
ProjStarPath="" >
<!-- Standard block -->
<cb:StandardInit-block/>
<!-- Trigger block -->
<cb:WeeklyBuild-block/>
<tasks></tasks>
<publishers></publishers>
</cb:scope>
</project>
答案 0 :(得分:1)
本周我也遇到了这个问题,因为我还决定将这种DRY方法用于CruiseControl。
启动criusecontrol服务后(然后很快失败)我查看了日志文件(C:\ CruiseControl.NET \ server \ ccnet.log for me ...),我看到了类似的内容:
ThoughtWorks.CruiseControl.Core.Config.ConfigurationException:检测到重复节点:...(导致问题的其余节点)
至少让我知道它有什么问题。
答案 1 :(得分:0)
在此处发布您的xml文件时不确定是否存在疏忽,但您在Test-project.xml中没有结尾</project>
。
答案 2 :(得分:0)
的ccnet.config:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<!-- Standard Inits -->
<cb:define name="StandardInit-block">
<!--<webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&server=local&project=Introvert</webURL>-->
<artifactDirectory>D:\CC\$(ProjName)\artifact\</artifactDirectory>
<modificationDelaySeconds>120</modificationDelaySeconds>
</cb:define>
<!-- Trigger run weekly -->
<!-- Vars $(TriggerTime), $(ProjName) -->
<cb:define name="WeeklyBuild-block">
<triggers>
<scheduleTrigger time="$(TriggerTime)" buildCondition="ForceBuild" name="Nightly build at $(TriggerTime) for $(ProjName)">
<weekDays>
<weekDay>Monday</weekDay>
<weekDay>Tuesday</weekDay>
<weekDay>Wednesday</weekDay>
<weekDay>Thursday</weekDay>
<weekDay>Friday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
</cb:define>
<cb:include href="Test-project.xml" />
</cruisecontrol>
试验project.xml中:
<project name="Test" xmlns:cb="urn:ccnet.config.builder">
<cb:scope
TriggerTime="2:30"
ProjName="Test"
ProjStarPath="" >
<!-- Standard block -->
<cb:StandardInit-block/>
<!-- Trigger block -->
<cb:WeeklyBuild-block/>
<tasks/>
<publishers/>
</cb:scope>
</project>
刚刚通过我的盒子上的cruisecontrol运行这个批次,我得到的唯一问题是ccnet.config文件中的URL。删除它,我粘贴在此文本上方的代码工作正常。