您的位置:首页 > 产品设计 > UI/UE

CruiseControl.NET配置文件(生产环境版本,与SVN结合自动部署)

2016-11-23 01:52 603 查看
配置如下:

说明:此配置文件的功能是当有SVN修改时,会自动触发并编译发布,间隔为10秒。

由于配置文件上面有注释,如果提示节点配置错误,请删除这些注释。

官方详细节点配置说明:http://www.cruisecontrolnet.org/projects/ccnet/wiki/index

<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>
     <!--FTP上传节点-->
<ftp>
<serverName>【地址,不带FTP开头】</serverName>
<userName>【用户名】</userName>
<password>【密码】</password>
<action>【UploadFolder/DownloadFolder两种选择,可上传或下载】</action>
<ftpFolderName>【FTP服务器上的路径】</ftpFolderName>
<localFolderName>【本地要上传的】</localFolderName>
<recursiveCopy>【true,是否执行递归复制】</recursiveCopy>
</ftp>
</tasks>
<triggers>
<!--定时执行任务,当配置SVN时,那么会自动检测是否有改动,如果有改动时,才会获取最新代码,然后编译最后发布-->
<intervalTrigger seconds="10"/>
</triggers>
<publishers>
<!--编译邮件配置,如果用163邮箱,需要开通SMTP服务获取第三方key,不推荐用QQ邮箱-->
<email mailport="25" includeDetails="TRUE" mailhostUsername="【邮箱地址,如:x@x.com】" mailhostPassword="【邮箱密码】" useSSL="FALSE">
<from>【邮箱地址,如:x@x.com】</from>
<mailhost>【邮箱XMTP服务器,如:smtp.x.com】</mailhost>
<users>
<!--配置接收人员邮箱,节点可多个,含义:name-姓名;group-属于哪个组,每个组可以设置接收邮件的类型;address-邮件地址-->
<user name="EasonJim" group="buildmaster" address="x@x.com" />
</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>


以上节点的配置已经在生产环境运行正常,如发现不能时候请即时联系我。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐