Source Control Plugin for CruiseControl.NET that talks to git.
<sourcecontrol type="git">
<repository>git@github.com:dogeth/ccnet.git.plugin.git</repository>
</sourcecontrol>
<sourcecontrol type="git">
<repository>git@github.com:dogeth/ccnet.git.plugin.git</repository>
<branch>master</branch>
<autoGetSource>true</autoGetSource>
<executable>git</executable>
<tagOnSuccess>false</tagOnSuccess>
<tagCommitMessage>ccnet build {0}</tagCommitMessage>
<workingDirectory>c:\build\ccnet.git.plugin</workingDirectory>
<timeout>60000</timeout>
</sourcecontrol>
Before even attempting to use this plugin, take note of the following
-
Your path should include %ProgramFiles%Gitbin and %ProgramFiles%Gitcmd
-
The HOME environment variable should be set to %USERPROFILE%
-
You should be able to run git from a standard command prompt.
-
I’m not checking for multiple heads, like the mercurial source control class. Didn’t see that situation arising in our current git workflow so I didn’t bother.
-
The position of each modification in the list is used as the ChangeNumber. WHen 1.5 comes around may be able to use the commit hash instead.
-
The type of modification is used to store the commit hash. Should expand this to actual file information.
-
Commit level modifications are used. Actual files changed in each commit are not published. Obviously something which could be implemented but have run out of time for the moment.
I took a lot of ideas from the following
I also got some great feedback from Xerxes Battiwalla, see his blog post on the matter at www.xerxesb.com/2009/getting-cruisecontrolnet-to-talk-to-git/