I have go CruiseControl.NET successfully building my solution. Before it builds, it increments the version number in a shared "assemblyinfo.cs" - I wrote a custom command-line util to do this.
My project is setup as follows:
<sourcecontrol type="git">
<repository>[email protected]:repo.git</repository>
<branch>develop</branch>
<autoGetSource>true</autoGetSource>
<fetchSubmodules>true</fetchSubmodules>
<tagOnSuccess>true</tagOnSuccess>
<commitBuildModifications>true</commitBuildModifications>
<commitUntrackedFiles>false</commitUntrackedFiles>
<tagCommitMessage>Auto Build {0}</tagCommitMessage>
<tagNameFormat>Auto-Build-{0}</tagNameFormat>
<committerName>Build Server</committerName>
<committerEMail>[email protected]</committerEMail>
<workingDirectory>C:\Scratch\repo</workingDirectory>
<timeout units="hours">2</timeout>
</sourcecontrol>
<tasks>
<exec>
<!-- Custom version incrementor -->
<executable>C:\Program Files (x86)\CruiseControl.NET\VersionIncrementor.exe</executable>
<buildArgs>C:\Scratch\repo\SharedAssemblyInfo.cs</buildArgs>
<description>Increment Version</description>
</exec>
<devenv>
<solutionfile>C:\Scratch\repo\test.sln</solutionfile>
<configuration>Debug</configuration>
<executable>C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com</executable>
</devenv>
</tasks>
<publishers>
<xmllogger />
<artifactcleanup cleanUpMethod="KeepLastXBuilds"
cleanUpValue="10" />
</publishers>
So far, it is commit the incremented version locally, but how do I get it to push that commit to origin?
UPDATE
My changes are getting committed, they just aren't getting pushed. When I open up the repo on the build machine in SourceTree see that it is "detached from origin/develop", I also see that the version is getting incremented and the commit is getting tagged, but the commit is not in my branch.
You have
commitBuildModifications
andtagOnSuccess
turned on, so any changes would be committed during the 'publish' of the build. There would be no need to change your configuration.See the Tagging a successful build section http://cruisecontrolnet.org/projects/ccnet/wiki/Git