RSS Builds Publisher for CC.NET에 가서 최신 플러그인을 다운로드 받는다. 압축 해제한 파일을 CC .NET 서버 폴더(예. C:\Program Files\CruiseControl.NET\server\)에 놓는다.

이제 ccnet.config 설정 파일에 RSS Publisher를 등록한다. 이런 식이다.

<cruisecontrol>
    <project>
        <name>Money</name>
        <webURL>http://domain/ccnet</webURL>
        <workingDirectory>c:\src\Money</workingDirectory>
        <triggers>
            <intervalTrigger seconds="60"/>
        </triggers>
        <modificationDelaySeconds>2</modificationDelaySeconds>
        <sourcecontrol type="nullSourceControl">
        </sourcecontrol>
        <tasks>
            <devenv>              <solutionfile>C:\src\Money\MoneyTestApp.sln</solutionfile>
                <configuration>Debug</configuration>
                <buildtype>Build</buildtype>
                <executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe</executable>
            </devenv>
        </tasks>
        <publishers>          
            <rssBuilds encoding="utf-8" buildCondition="AllBuildConditions" addEnclosure="true">
            
                <outputPath>C:\Program Files\CruiseControl.NET\webdashboard\rss\</outputPath>
                <fileName>$(ProjectName)</fileName>
                <!-- 
                  encoding : a valid encoding (default=utf-8).
                  fileName : the file name with out the extension
                  buildCondition : the BuildCondition in which the items will be added to the file. The default is AllBuildConditions
                  addEnclosure : true will add an enclosure to the added item using {enclosureUrlFormat}
                -->
                <!-- Collection of namespaces added to the feed -->
                <rssExtensions>
                  <namespace prefix="slash" namespaceURI="http://purl.org/rss/1.0/modules/slash/" />
                  <namespace prefix="test" namespaceURI="urn:test" />
                </rssExtensions>
                <!-- the feed image -->
                <feedImage url="http://mydomain.com/images/logo.png" title="$(ProjectName)" link="$(ProjectUrl)" />
                <!-- maximum number of items to keep in the main feed.
                  all older items are moved to {filename}.history.xml 
                -->
                <maxHistory>25</maxHistory>
                <channelUrl>$(ProjectUrl)</channelUrl>
                <itemUrl>http://mydomain.com/builds/$(Label)/$(ProjectName).$(Label).zip</itemUrl>
                <enclosureUrl>$(itemUrl)</enclosureUrl>
                <feedTitle>Builds for $(ProjectName)</feedTitle>
                <feedDescription>Build Report for $(ProjectName)</feedDescription>
                <itemTitle>$(ProjectName) $(Label)</itemTitle>
                <!-- Collection of rssElements that are added to the channel -->
                <feedElements>
                  <!-- 
                    name : Required - Element name
                    value : Required - Element Value
                    prefix : Optional - Element Prefix. The prefix must be included in the rssExtensions 
                    or be one of the following:
                      * dc
                      * ci
                  -->
                  <rssElement name="webmaster" value="kaistizen@sk-imedia.com" />
                </feedElements>
                <!-- Collection of rssElements that are added to each item -->
                <itemElements>
                  <rssElement prefix="dc" name="creator" value="Ryan" />
                  <rssElement prefix="test" name="sampleNode">
                    <attributes>
                      <attribute name="attribute1" value="someValue" />
                    </attributes>
                    <childElements>
                      <rssElement prefix="test" name="anotherNode" value="anotherValue">
                        <attributes>
                          <attribute name="anotherAttribute" value="some other value" />
                        </attributes>
                      </rssElement>
                    </childElements>
                  </rssElement>
                </itemElements>
                <!-- A collection of categories that are added to each item -->
                <categories>
                  <!-- name : Required - The category name -->
                  <category name="NightlyBuilds" />
                  <category name="CC.NET" />
                  <category name="Publisher" />
                  <category name="$(ProjectName)" />
                  <category name="$(ProjectName) $(Label)" />
                </categories>
                <!-- The string that is used as the item description before the modification comments. -->
                <descriptionHeader><![CDATA[<p>]]></descriptionHeader>
                <!-- The string that is used as the item description after the modification comments. -->
                <descriptionFooter>
                  <![CDATA[</p>
          <p><a href="http://mydomain.com/builds/$(Label)/$(ProjectName).$(Label).zip">$(ProjectName) $(Label) Binaries</a><br />
          <a href="http://mydomain.com/builds/$(Label)/$(ProjectName).$(Label).src.zip">$(ProjectName) $(Label) Source</a><br />
          <a href="http://mydomain.com/builds/$(Label)/$(ProjectName).$(Label).msi.zip">$(ProjectName) $(Label) Installer</a><br />
          </p>]]>
                </descriptionFooter>
              </rssBuilds>
        </publishers>
        <externalLinks>
            <externalLink name="RSS Feed!!!" url="http://domain/ccnet/rss/ProjectName.xml" />
        </externalLinks>
    </project>
</cruisecontrol>

여기서 주목할 부분은 <outputPath> 요소이다. 다른 경로로 잡아도 되겠지만, http://domain/ccnet/rss/projectname.xml 식의 주소를 쓴다고 가정한다. 그리고 마지막에 <externalLink> 요소에서 해당 RSS의 경로를 명시해주면, 대시보드에서 링크를 볼 수 있다.

우선 CC .NET 대시보드 폴더(예. C:\Program Files\CruiseControl.NET\webdashboard\)에 RSS 폴더를 하나 만든다. 그리고 여기에 Web.config 파일을 만들어 넣는데, 내용물은 이런 식으로 구성한다.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.web>
        <httpHandlers>
            <add verb="*" path="*.aspx" type="System.Web.DefaultHttpHandler"/>
            <add verb="*" path="*.xml" type="System.Web.StaticFileHandler"/>
            <add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler"/>
        </httpHandlers>
        <compilation defaultLanguage="c#" debug="true" />
        <customErrors mode="ReadOnly" />
        
        <trace
            enabled="false"
            requestLimit="10"
            pageOutput="true"
            traceMode="SortByTime"
            localOnly="true"
        />
        <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    </system.web>
</configuration>

끝이다.


설정 파일 손쉽게 구성하기

CCNet Config라는 프로그램을 쓰면 CC .NET의 설정 파일을 만들기가 한결 쉬워진다. 더욱이 RSS Publisher까지 지원한다. 하지만 버전이 낮아서인지(현재 버전. 0.4.13.1 Production) 몇 가지 유의 사항이 있다.

  • 64비트 윈도우에선 제대로 작동하지 않는 듯 하다. CC .NET 없이도 독립적으로 작동하므로 윈도우 XP에서 설정 파일을 만들어서 64비트 윈도우를 쓰는 서버에 업로드하는 방식을 쓰면 된다.

  • C:\Documents and Settings\UserName\Application Data\CCNetConfig\Settings.config 파일이 없다면서 오류를 내기도 한다. 명백한 버그인데, 해당 파일의 '숨김' 속성을 제거해주면 된다.

  • 처음엔 RSS Publisher를 메뉴에서 볼 수 없다. RSS Publisher를 설정하고 싶다면, [Tools - Options - Components]에서 RSS Publishser를 찾아서 선택하면 된다.