1.下载安装文件

下载ccent(https://sourceforge.net/projects/ccnet/)安装后,会有下面的文件夹。

server 是服务端,后台会有一个windows service运行,桌面会生成一个console application的快捷方式。
webdashboard是管理发布的控制网站,需要在服务器上创建网站,然后将虚拟目录指定到这个路径。这个是负责管理ccnet的网站。

2.配置ccnet.config

这里主要是配置project,就是你要管理的项目。下面是全文模板

结合lcomplete提供的配置文件,主要是Task部分,测试可以用的配置文件如下(ccnet.config):

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">  
  <!-- This is your CruiseControl.NET Server Configuration file.
       Add your projects below! -->  
  <project name="example.com" description="example.com Test" queue="Q1"> 
    <state type="state" directory="D:\ccnet\RightIC\State"/>  
    <workingDirectory>D:\ccnet\RightIC\Working</workingDirectory>  
    <artifactDirectory>D:\ccnet\RightIC\Artifacts</artifactDirectory>  
    <sourcecontrol type="svn"> 
      <executable>C:\Program Files (x86)\Subversion\bin\svn.exe</executable>  
      <trunkUrl>svn://192.168.13.32/ric/branches/spring_ric_1</trunkUrl>  
      <workingDirectory>D:\ccnet\RightIC\Working\</workingDirectory>  
      <username>YWZ</username>  
      <password>ywz123</password> 
    </sourcecontrol>  
    <labeller type="svnRevisionLabeller"> 
      <major>1</major>  
      <minor>0</minor>  
      <pattern>{major}.{minor}.{build}.{revision}</pattern>  
      <url>svn://192.168.13.32/ric/branches/spring_ric_1</url> 
    </labeller>  
    <tasks> 
      <msbuild> 
        <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>  
        <workingDirectory>D:\ccnet\RightIC\Working\src\RightIC.Web\</workingDirectory>  
        <projectFile>RightIC.Web.csproj</projectFile>  
        <buildArgs>/t:ResolveReferences;Compile /t:_CopyWebApplication /p:Configuration=Release /p:WebProjectOutputDir=D:\ccnet\RightIC\Artifacts\publish /p:OutputPath=D:\ccnet\RightIC\Artifacts\publish\bin</buildArgs> 
      </msbuild> 
    </tasks> 
  </project>  
  <project name="dbm" description="dbm Test" queue="Q2"> 
    <state type="state" directory="D:\ccnet\DBM\State"/>  
    <workingDirectory>D:\ccnet\DBM\Working</workingDirectory>  
    <artifactDirectory>D:\ccnet\DBM\Artifacts</artifactDirectory>  
    <sourcecontrol type="svn"> 
      <executable>C:\Program Files (x86)\Subversion\bin\svn.exe</executable>  
      <trunkUrl>svn://192.168.13.32/TestProject</trunkUrl>  
      <workingDirectory>D:\ccnet\DBM\Working\</workingDirectory>  
      <username>YWZ</username>  
      <password>ywz123</password> 
    </sourcecontrol>  
    <labeller type="svnRevisionLabeller"> 
      <major>1</major>  
      <minor>0</minor>  
      <pattern>{major}.{minor}.{build}.{revision}</pattern>  
      <url>svn://192.168.13.32/TestProject</url> 
    </labeller>  
    <tasks> 
      <msbuild> 
        <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>  
        <workingDirectory>D:\ccnet\DBM\Working\TestProject.Web\</workingDirectory>  
        <projectFile>TestProject.Web.csproj</projectFile>  
        <buildArgs>/t:ResolveReferences;Compile /t:_CopyWebApplication /p:Configuration=Release /p:WebProjectOutputDir=D:\ccnet\DBM\Artifacts\publish /p:OutputPath=D:\ccnet\DBM\Artifacts\publish\bin</buildArgs> 
      </msbuild> 
    </tasks> 
  </project> 
</cruisecontrol>

3.配置dashboard.config

这个配置文件主要是针对控制面板的配置,包括服务器,网站主题等
注意:配置过程中,主要是启动桌面的控制台程序,这样可以看到错误信息,便于调试。
正常运行的时候,就可以用windows服务来运行了,就不用启动控制台程序了。

<dashboard> 
  <remoteServices> 
    <servers> 
      <!-- Update this list to include all the servers you want to connect to. NB - each server name must be unique -->  
      <server name="local" url="tcp://localhost:21234/CruiseManager.rem" allowForceBuild="true" allowStartStopBuild="true" backwardsCompatible="false"/> 
    </servers> 
  </remoteServices>  
  <plugins> 
    <farmPlugins> 
      <farmReportFarmPlugin categories="false" refreshInterval="0" successBar="Bottom"/>  
      <cctrayDownloadPlugin/>  
      <administrationPlugin password="123456"/> 
    </farmPlugins>  
    <serverPlugins> 
      <serverReportServerPlugin/>  
      <serverLogServerPlugin/> 
    </serverPlugins>  
    <projectPlugins> 
      <projectReportProjectPlugin/>  
      <viewProjectStatusPlugin/>  
      <latestBuildReportProjectPlugin/>  
      <viewAllBuildsProjectPlugin/>  
      <serverLogProjectPlugin/> 
    </projectPlugins>  
    <buildPlugins> 
      <buildReportBuildPlugin> 
        <xslFileNames> 
          <xslFile>xsl\header.xsl</xslFile>  
          <xslFile>xsl\modifications.xsl</xslFile>  
          <xslFile>xsl\msbuild2ccnet.xsl</xslFile> 
        </xslFileNames> 
      </buildReportBuildPlugin>  
      <buildLogBuildPlugin disableHighlightingWhenLogExceedsKB="50"/> 
    </buildPlugins>  
    <securityPlugins> 
      <simpleSecurity/> 
    </securityPlugins>  
    <customTemplates>themes/liquidBlue/templates</customTemplates> 
  </plugins> 
</dashboard>

贴一个安装完成的页面

发表评论

电子邮件地址不会被公开。 必填项已用*标注