配置如下:
说明:此配置文件的功能是当有SVN修改时,会自动触发并编译发布,间隔为10秒。
<cruisecontrol xmlns:cb="urn:ccnet.config.builder"> <!--项目说明,节点可多个--> <project name="【项目名】" description="【项目详情】" queue="Q1"> <!--编译日志存放--> <artifactDirectory>【构建日志输出存放路径】</artifactDirectory> <!--源代码管理配置--> <sourcecontrol type="svn"> <executable>【SVN.EXE路径】</executable> <username>【SVN账号】</username> <password>【SVN密码】</password> <autoGetSource>true</autoGetSource> <trunkUrl>【SVN地址:http那个】</trunkUrl> <workingDirectory>【源代码迁出的位置】</workingDirectory> </sourcecontrol> <tasks> <!--MSBUILD编译项目,节点可多个--> <msbuild> <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> <buildArgs> /p:OutputPath=【项目编译后存放的位置】 </buildArgs> <workingDirectory>【项目源代码存放的位置】</workingDirectory> <projectFile>【项目.csproj文件】</projectFile> <targets>Build</targets> <timeout>900000</timeout> </msbuild> <!--命令行配置,节点可多个--> <exec> <!--复制命令--> <executable>xcopy</executable> <buildArgs>/y 【源文件或目录】 【目标目录】</buildArgs> <buildTimeoutSeconds>30</buildTimeoutSeconds> </exec> <exec> <!--删除命令--> <executable>cmd</executable> <buildArgs>/c del 【要删除的目录或文件,文件支持*.txt类型】</buildArgs> <buildTimeoutSeconds>30</buildTimeoutSeconds> </exec> <!--编译后的文件发布到站点,节点可多个--> <buildpublisher> <sourceDir>【编译后的项目存放路径】</sourceDir> <publishDir>【站点的路径】</publishDir> <useLabelSubDirectory>false</useLabelSubDirectory> </buildpublisher> </tasks> <triggers> <!--定时执行任务,当配置SVN时,那么会自动检测是否有改动,如果有改动时,才会获取最新代码,然后编译最后发布--> <intervalTrigger seconds="10"/> </triggers> <publishers> <!--编译邮件配置,如果用163邮箱,需要开通SMTP服务获取第三方key,不推荐用QQ邮箱--> <email mailport="25" includeDetails="TRUE" mailhostUsername="【邮箱地址,如:[email protected]】" mailhostPassword="【邮箱密码】" useSSL="FALSE"> <from>【邮箱地址,如:[email protected]】</from> <mailhost>【邮箱XMTP服务器,如:smtp.x.com】</mailhost> <users> <!--配置接收人员邮箱,节点可多个,含义:name-姓名;group-属于哪个组,每个组可以设置接收邮件的类型;address-邮件地址--> <user name="EasonJim" group="buildmaster" address="[email protected]" /> </users> <groups> <!--配置不同的组,对应编译的类型进行邮件发送,节点可多个--> <group name="developers"> <notifications> <notificationType>Failed</notificationType> <notificationType>Fixed</notificationType> </notifications> </group> <group name="buildmaster"> <notifications> <notificationType>Always</notificationType> </notifications> </group> </groups> <xslFiles> <file>xsl\header.xsl</file> <file>xsl\modifications.xsl</file> <file>xsl\unittests.xsl</file> <file>xsl\MsTestSummary2008.xsl</file> <file>xsl\compile-msbuild.xsl</file> <file>xsl\SimianSummary.xsl</file> <file>xsl\MsTestSummary2010.xsl</file> <file>xsl\MsTestSummary.xsl</file> <file>xsl\MsTestReport2010.xsl</file> <file>xsl\MsTestCover2010.xsl</file> </xslFiles> <modifierNotificationTypes> <NotificationType>Failed</NotificationType> <NotificationType>Fixed</NotificationType> </modifierNotificationTypes> <subjectSettings> <subject buildResult="StillBroken" value="Build is still broken for {CCNetProject}" /> </subjectSettings> </email> <statistics /> <xmllogger /> </publishers> </project> </cruisecontrol>
以上节点的配置已经在生产环境运行正常,如发现不能时候请即时联系我。
时间: 2024-12-17 11:07:23