External Source Control Configuration¶
A source control implementation for use when the source control system doesn't integrate directly with CCNet.
Version¶
Available from version 1.3
Examples¶
Minimal Configuration
1<sourcecontrol type="external">
2 <executable>path to command-line application</executable>
3</sourcecontrol>
Full Example
1<sourcecontrol type="external">
2 <executable>path to command-line application</executable>
3 <args>arguments for the command-line application</args>
4 <autoGetSource>false</autoGetSource>
5 <labelOnSuccess>false</labelOnSuccess>
6 <environment>
7 <var>name=value</var>
8 <var>name=value</var>
9 </environment>
10 <timeout units="minutes">10</timeout>
11</sourcecontrol>
Configuration Elements¶
Element | Description | Type | Required | Default | Version |
type | The type of source control block. | String - must be external | Yes | n/a | 1.3 |
args | A string to be passed to the external source control program in commands. The string will be passed exactly as specified. In particular, it will not be enclosed quotation marks, thus allowing you to specify what the executable will see as multiple parameters. |
String | No | None | 1.3 |
autoGetSource | Should we automatically obtain updated source from the source control system or not? | Boolean | No | false | 1.3 |
dynamicValues | The dynamic values to use for the source control block. | Dynamic Values array | No | None | 1.5 |
environment | A set of environment variables set for commands that are executed. | Environment Variable array | No | None | 1.3 |
executable | Name of the source control system executable to run. | String | Yes | n/a | 1.3 |
issueUrlBuilder | Converts the comment (or parts from it) into an url pointing to the issue for this build. See IssueUrlBuilder for more details. | IssueUrlBuilder | No | None | 1.4 |
labelOnSuccess | If set, the source repository will be tagged with the build label upon successful builds. | Boolean | No | false | 1.3 |
timeout | Sets the timeout period for the source control operation. See Timeout Configuration for details. | Timeout Configuration | No | 10 minutes | 13 |
Notes¶
Each of the three sourcecontrol operations (GetModifications(), GetSource(), and LabelSourceControl()) are passed to the source control command as a command line.
GetModifications¶
The GetModifications function is invoked as the GETMODS operation, and specifying a starting and ending timestamp:
1 executable GETMODS "fromtimestamp" "totimestamp" args
2
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 Modification Writer Task, 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.
1<ArrayOfModification>
2 <Modification>
3 <ChangeNumber>12245</ChangeNumber>
4 <Comment>New Project for testing stuff</Comment>
5 <EmailAddress>JUser@Example.Com</EmailAddress>
6 <FileName>AssemblyInfo.cs</FileName>
7 <FolderName>Dev\Server\Interface\Properties\</FolderName>
8 <ModifiedTime>2006-11-22T11:11:00-0500</ModifiedTime>
9 <Type>add</Type>
10 <UserName>joe_user</UserName>
11 <Url>http://www.example.com/index.html</Url>
12 <Version>5</Version>
13 </Modification>
14 <Modification>
15 <ChangeNumber>12244</ChangeNumber>
16 <Comment>New Project for accessing web services</Comment>
17 <EmailAddress>SSpade@Example.Com</EmailAddress>
18 <FileName>Interface</FileName>
19 <FolderName>Dev\Server\</FolderName>
20 <ModifiedTime>2006-11-22T11:10:44-0500</ModifiedTime>
21 <Type>add</Type>
22 <UserName>sam_spade</UserName>
23 <Url>http://www.example.com/index.html</Url>
24 <Version>4</Version>
25 </Modification>
26</ArrayOfModification>
GetSource¶
The GetSource function is invoked as the GETSOURCE operation, and specifying a working directory path and the target timestamp:
1 executable GETSOURCE "workingdirectory" "timestamp" args
2
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).
LabelSourceControl¶
The LabelSourceControl function is invoked as the SETLABEL operation, and specifying a label to be applied and the target timestamp:
1 executable SETLABEL "label" "sourcetimestamp" args
2
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).
warning
p.
Watch out for the comment tag, if this contains dodgy charatecters eg.: < it will fail the getsource. Be sure to escape these characters. So replace these with there XML equivalents : <
Be careful of the <ModifiedTime>, this MUST be more than the fromtimestamp if it is <= then the modification will not be detected.
You don't need the following parameters for this to work:
* <Type /> * <FileName /> * <FolderName /> * <Version /> * <EmailAddress />
Automatically Generated¶
Documentation generated on Monday, 26 May 2014 at 7:18:02 AM