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


    配置如下:

    说明:此配置文件的功能是当有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:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.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>xslheader.xsl</file>
                        <file>xslmodifications.xsl</file>
                        <file>xslunittests.xsl</file>
                        <file>xslMsTestSummary2008.xsl</file>
                        <file>xslcompile-msbuild.xsl</file>
                        <file>xslSimianSummary.xsl</file>
                        <file>xslMsTestSummary2010.xsl</file>
                        <file>xslMsTestSummary.xsl</file>
                        <file>xslMsTestReport2010.xsl</file>
                        <file>xslMsTestCover2010.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>

    以上节点的配置已经在生产环境运行正常,如发现不能时候请即时联系我。

  • 相关阅读:
    UI/UE对个性化推荐的影响
    毫秒转换为天、小时、分、秒
    查生字
    探秘推荐引擎之协同过滤算法小综述
    给文献添加上标
    雅可比迭代和高斯赛德尔迭代
    广义二项式定理求解系数
    关于最大流的EdmondsKarp算法详解
    海量数据处理利器之布隆过滤器
    [leetcode] Path sum路径之和
  • 原文地址:https://www.cnblogs.com/EasonJim/p/5773328.html
Copyright © 2020-2023  润新知