208 lines
13 KiB
HTML
Executable File
208 lines
13 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>CruiseControl.NET : External Source Control</title>
|
|
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
</head>
|
|
|
|
<body>
|
|
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
|
<tr>
|
|
<td valign="top" class="pagebody">
|
|
<div class="pageheader">
|
|
<span class="pagetitle">
|
|
CruiseControl.NET : External Source Control
|
|
</span>
|
|
</div>
|
|
<div class="pagesubheading">
|
|
This page last changed on Feb 25, 2009 by <font color="#0050B2">williams</font>.
|
|
</div>
|
|
|
|
<h3><a name="ExternalSourceControl-ExternalSourceControlConfiguration"></a>External Source Control Configuration</h3>
|
|
|
|
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Note: The External source control block is available in CCNet build 1.3.0.3053 and later.</td></tr></table></div>
|
|
|
|
<h4><a name="ExternalSourceControl-Typical%2FMinimalConfiguration"></a>Typical / Minimal Configuration</h4>
|
|
|
|
<p>For most uses the following is all you'll need in your <a href="Configuring the Server.html" title="Configuring the Server"><tt>ccnet.config</tt></a>:</p>
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
<pre class="code-xml"><span class="code-tag"><sourcecontrol type=<span class="code-quote">"external"</span>></span>
|
|
<span class="code-tag"><executable></span>path to command-line application<span class="code-tag"></executable></span>
|
|
<span class="code-tag"></sourcecontrol></span></pre>
|
|
</div></div>
|
|
<p>This will:</p>
|
|
<ul>
|
|
<li>monitor for any changes in the workspace located at the project working directory, by passing GETMODS to the external executable</li>
|
|
<li>retrieve the lastest source when any changes are detected, by passing GETSOURCE to the external executable</li>
|
|
<li>apply a label to (<em>i.e.</em>, make a snapshot of) the built files at the end of each successful build, by passing SETLABEL to the external executable</li>
|
|
</ul>
|
|
|
|
|
|
<h4><a name="ExternalSourceControl-FullConfiguration"></a>Full Configuration</h4>
|
|
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
<pre class="code-xml"><span class="code-tag"><sourcecontrol type=<span class="code-quote">"external"</span>></span>
|
|
<span class="code-tag"><executable></span>path to command-line application<span class="code-tag"></executable></span>
|
|
<span class="code-tag"><args></span>arguments for the command-line application<span class="code-tag"></args></span>
|
|
<span class="code-tag"><autoGetSource></span>false<span class="code-tag"></autoGetSource></span>
|
|
<span class="code-tag"><labelOnSuccess></span>false<span class="code-tag"></labelOnSuccess></span>
|
|
<span class="code-tag"><environment></span>
|
|
<span class="code-tag"><var></span>name=value<span class="code-tag"></var></span>
|
|
<span class="code-tag"><var></span>name=value<span class="code-tag"></var></span>
|
|
...
|
|
<span class="code-tag"></environment></span>
|
|
<span class="code-tag"><timeout units=<span class="code-quote">"minutes"</span>></span>10<span class="code-tag"></timeout></span>
|
|
<span class="code-tag"></sourcecontrol></span></pre>
|
|
</div></div>
|
|
<table class='confluenceTable'><tbody>
|
|
<tr>
|
|
<th class='confluenceTh'> Element </th>
|
|
<th class='confluenceTh'> Description </th>
|
|
<th class='confluenceTh'> Type </th>
|
|
<th class='confluenceTh'> Required </th>
|
|
<th class='confluenceTh'> Default </th>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> args </td>
|
|
<td class='confluenceTd'> Specifies the command line arguments to be passed to the source control command. </td>
|
|
<td class='confluenceTd'> string </td>
|
|
<td class='confluenceTd'> no </td>
|
|
<td class='confluenceTd'> "" </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> autoGetSource </td>
|
|
<td class='confluenceTd'> Specifies whether the current version of the source should be retrieved from the source control system. </td>
|
|
<td class='confluenceTd'> bool </td>
|
|
<td class='confluenceTd'> no </td>
|
|
<td class='confluenceTd'> false </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> environment </td>
|
|
<td class='confluenceTd'> Specifies any environment variables to set for the source control command </td>
|
|
<td class='confluenceTd'> complex </td>
|
|
<td class='confluenceTd'> no </td>
|
|
<td class='confluenceTd'> (none) </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> executable </td>
|
|
<td class='confluenceTd'> Specifies the path to the source control command. </td>
|
|
<td class='confluenceTd'> string </td>
|
|
<td class='confluenceTd'> yes </td>
|
|
<td class='confluenceTd'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> labelOnSuccess </td>
|
|
<td class='confluenceTd'> Specifies whether or not CruiseControl.Net should ask the source control system to label the source when the build is successful. </td>
|
|
<td class='confluenceTd'> bool </td>
|
|
<td class='confluenceTd'> no </td>
|
|
<td class='confluenceTd'> false </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> timeout </td>
|
|
<td class='confluenceTd'> Sets the timeout period for the source control operation. See <a href="Timeout Configuration.html" title="Timeout Configuration">Timeout Configuration</a> for details. </td>
|
|
<td class='confluenceTd'> Timeout </td>
|
|
<td class='confluenceTd'> no </td>
|
|
<td class='confluenceTd'> 10 minutes </td>
|
|
</tr>
|
|
<tr>
|
|
<td class='confluenceTd'> issueUrlBuilder </td>
|
|
<td class='confluenceTd'> Converts the comment (or parts from it) into an url pointing to the issue for this build. <br clear="all" />
|
|
See <a href="IssueUrlBuilder.html" title="IssueUrlBuilder">Issue Builder</a> for more details <br clear="all" /> </td>
|
|
<td class='confluenceTd'> Group </td>
|
|
<td class='confluenceTd'> N/A </td>
|
|
<td class='confluenceTd'> false <br clear="all" /> </td>
|
|
</tr>
|
|
</tbody></table>
|
|
|
|
<h4><a name="ExternalSourceControl-Operation"></a>Operation</h4>
|
|
|
|
<p>Each of the three sourcecontrol operations (GetModifications(), GetSource(), and LabelSourceControl()) are passed to the source control command as a command line.</p>
|
|
|
|
<h5><a name="ExternalSourceControl-GetModifications"></a>GetModifications</h5>
|
|
|
|
<p>The GetModifications function is invoked as the <b>GETMODS</b> operation, and specifying a starting and ending timestamp:</p>
|
|
<ul>
|
|
<li><em>executable</em> <b>GETMODS</b> "<em>fromtimestamp</em>" "<em>totimestamp</em>" <em>args</em></li>
|
|
</ul>
|
|
|
|
|
|
<p>The source control command should search for modifications between these two times inclusively, write their details to the standard output stream in the XML format used by the <a href="Modification Writer Task.html" title="Modification Writer Task">Modification Writer Task</a>, and exit with exit status 0 (any other status indicates an error and will fail the build). For example, the following represents two modifications, numbered 12244 and 12245.</p>
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
<pre class="code-xml"><span class="code-tag"><?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"utf-8"</span>?></span>
|
|
<span class="code-tag"><ArrayOfModification></span>
|
|
<span class="code-tag"><Modification></span>
|
|
<span class="code-tag"><ChangeNumber></span>12245<span class="code-tag"></ChangeNumber></span>
|
|
<span class="code-tag"><Comment></span>New Project for testing stuff<span class="code-tag"></Comment></span>
|
|
<span class="code-tag"><EmailAddress></span>JUser@Example.Com<span class="code-tag"></EmailAddress></span>
|
|
<span class="code-tag"><FileName></span>AssemblyInfo.cs<span class="code-tag"></FileName></span>
|
|
<span class="code-tag"><FolderName></span>Dev\Server\Interface\Properties\<span class="code-tag"></FolderName></span>
|
|
<span class="code-tag"><ModifiedTime></span>2006-11-22T11:11:00-0500<span class="code-tag"></ModifiedTime></span>
|
|
<span class="code-tag"><Type></span>add<span class="code-tag"></Type></span>
|
|
<span class="code-tag"><UserName></span>joe_user<span class="code-tag"></UserName></span>
|
|
<span class="code-tag"><Url></span>http://www.example.com/index.html<span class="code-tag"></Url></span>
|
|
<span class="code-tag"><Version></span>5<span class="code-tag"></Version></span>
|
|
<span class="code-tag"></Modification></span>
|
|
<span class="code-tag"><Modification></span>
|
|
<span class="code-tag"><ChangeNumber></span>12244<span class="code-tag"></ChangeNumber></span>
|
|
<span class="code-tag"><Comment></span>New Project for accessing web services<span class="code-tag"></Comment></span>
|
|
<span class="code-tag"><EmailAddress></span>SSpade@Example.Com<span class="code-tag"></EmailAddress></span>
|
|
<span class="code-tag"><FileName></span>Interface<span class="code-tag"></FileName></span>
|
|
<span class="code-tag"><FolderName></span>Dev\Server\<span class="code-tag"></FolderName></span>
|
|
<span class="code-tag"><ModifiedTime></span>2006-11-22T11:10:44-0500<span class="code-tag"></ModifiedTime></span>
|
|
<span class="code-tag"><Type></span>add<span class="code-tag"></Type></span>
|
|
<span class="code-tag"><UserName></span>sam_spade<span class="code-tag"></UserName></span>
|
|
<span class="code-tag"><Url></span>http://www.example.com/index.html<span class="code-tag"></Url></span>
|
|
<span class="code-tag"><Version></span>4<span class="code-tag"></Version></span>
|
|
<span class="code-tag"></Modification></span>
|
|
<span class="code-tag"></ArrayOfModification></span></pre>
|
|
</div></div>
|
|
|
|
<h5><a name="ExternalSourceControl-GetSource"></a>GetSource</h5>
|
|
|
|
<p>The GetSource function is invoked as the <b>GETSOURCE</b> operation, and specifying a working directory path and the target timestamp:</p>
|
|
<ul>
|
|
<li><em>executable</em> <b>GETSOURCE</b> "<em>workingdirectory</em>" "<em>timestamp</em>" <em>args</em></li>
|
|
</ul>
|
|
|
|
|
|
<p>The source control command should update the files in the specified working directory to the versions current as of the specified time stamp and exit with exit status 0 (any other status indicates an error and will fail the build).</p>
|
|
|
|
<h5><a name="ExternalSourceControl-LabelSourceControl"></a>LabelSourceControl</h5>
|
|
|
|
<p>The LabelSourceControl function is invoked as the <b>SETLABEL</b> operation, and specifying a label to be applied and the target timestamp:</p>
|
|
<ul>
|
|
<li><em>executable</em> <b>SETLABEL</b> "<em>label</em>" "<em>sourcetimestamp</em>" <em>args</em></li>
|
|
</ul>
|
|
|
|
|
|
<p>The source control command should add the label to source repository and exit with exit status 0 (any other status indicates an error and will fail the build).</p>
|
|
|
|
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>
|
|
|
|
<p>° Watch out for the comment tag, if this contains dodgy charatecters eg.: <b><</b> it will fail the getsource. Be sure to escape these characters.<br/>
|
|
So replace these with there XML equivalents : <<br/>
|
|
° Be careful of the <ModifiedTime>, this MUST be more than the fromtimestamp if it is <= then the modification will not be detected.<br/>
|
|
° You don't need the following parameters for this to work:<br/>
|
|
<Type /><br/>
|
|
<FileName /><br/>
|
|
<FolderName /><br/>
|
|
<Version /><br/>
|
|
<EmailAddress /></p>
|
|
</td></tr></table></div>
|
|
<p><br clear="all" /></p>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><font color="grey">Document generated by Confluence on Mar 14, 2009 02:55</font></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html> |