当前位置:编程学习 > 网站相关 >>

ccnet +msbuild +svn 每日构建编译完成后自动发布并部署文件

<cruisecontrol>


<project>
    <webURL>http://127.0.0.1/ccnet/ViewFarmReport.aspx</webURL>
    <name>test4</name>
    <sourcecontrol type="svn"  autoGetSource="true">
      <trunkUrl>https://luyifeng.corp.ganji.com:8443/svn/helloword/test-svn/MvcApplication1/trunk/</trunkUrl>
      <executable>D:\Program Files (x86)\VisualSVN Server\bin\svn.exe</executable>
      <workingDirectory>E:\DailyBuild\mvctest1</workingDirectory>
      <username>luyifeng</username>
      <password>luyifeng1</password>


    </sourcecontrol>
    <tasks>
    
      <msbuild>
        <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <workingDirectory>E:\DailyBuild\mvctest1</workingDirectory>
        <projectFile>MvcApplication1.sln</projectFile>
        <logger>D:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
        <targets>Build</targets>
        <timeout>1900</timeout>
        <buildArgs></buildArgs>
      </msbuild>


      <msbuild>
        <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <workingDirectory>D:\Soft\ccnet\test-svn\MvcApplication1\MvcApplication1</workingDirectory>
        <projectFile>MvcApplication1.csproj</projectFile>
        <logger>D:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
        <targets>_WPPCopyWebApplication</targets>
        <timeout>900</timeout>
        <buildArgs>/p:Platform=AnyCPU;Configuration=Debug;WebProjectOutputDir=E:\DailyBuild\mvc_test_publish  /v:m</buildArgs>
      </msbuild>

-----在ccnet +msbuild +svn 每日构建( 一 ) 的基础上增加此条配置,基本不用多说,看配置就能明白大概意思

----大体意思是:编译解决方案里面的web项目,并通过WebProjectOutputDir=E:\DailyBuild\mvc_test_publish 发布到指定的目录,

---比如说测试环境的iis目录,这样就不用手动部署测试环境了,非常方便完成测试环境搭建

---但是这样会有一个问题,如果每次编译完成自动发布到测试环境的iis目录,会导致测试环境经常部署重启,进而导致测试同学无易做图常工作

---下一篇将解决这个问题,说明如何在编译完成后不进行自动部署到iis测试环境

 

    </tasks>


    <publishers>
      <statistics />
      <xmllogger />
      <email from="ganjialert@gmail.com" mailhost="smtp.gmail.com"
       mailhostPassword="ganji.com" mailhostUsername="ganjialert" useSSL="true"
       includeDetails="true">
        <users>
          <user name="luyifeng" address="luyifeng@ganji.com" group="developers" />
        </users>
        <groups>
          <group name="developers">
            <notifications>
              <NotificationType>Failed</NotificationType>
              <NotificationType>Exception</NotificationType>
            </notifications>
          </group>
          <group name="buildmaster" >
            <notifications>
              <NotificationType>Always</NotificationType>
            </notifications>
          </group>
        </groups>
      </email>
      <modificationHistory onlyLogWhenChangesFound="true" />
    </publishers>
    <triggers>
      <!--buildCondition="ForceBuild"-->
      <intervalTrigger name="continuous" seconds="30" />
    </triggers>
  </project>

 

</cruisecontrol>

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,