Change operation flow in cruisecontrol.net for DVCS?
Asked Answered
R

2

7

The CruiseControl.NET operation flow, documented in the Operation flow of CCNet FAQ, where the label is generated first makes some sense for a centralized VCS but not so much for a DVCS. With a DVCS, it would be better to generate the label after getting the source because the source itself might be needed for the label (e.g., the .hgtags file in Mercurial or other local source files used to compute version and build numbers).

Has anyone figured out a way to run the CCNet labeller after getting the source?

Rothman answered 14/12, 2010 at 16:39 Comment(2)
I never did figure out how to do this without modifying the core ccnet source code. I ended up switching to Jenkins (jenkins-ci.org) which works great.Rothman
Created issue #266 to evaluate to change the inner workflow of CCNet to support such scenarios.Vivavivace
W
3

We don't use the Labeller in CC.NET, but nevertheless, our approach might work for you as well:

  • create a separate project MercurialCheckout that performs
    • Mercurial checkout
    • Executable task that updates a text file triggers/mercurial.txt on the build server
  • change your "real" project from sourcecontrol type mercurial to sourcecontrol type filesystem, watching the triggers/directory

Your real project then includes the Labeller task, and since the Mercurial checkout was done before, the Labeller should generate the "right" label.

Kind regards Frank

Wichman answered 2/3, 2011 at 8:47 Comment(1)
Nice work-around, Frank. We've switched to using Hudson/Jenkins but I still like your idea.Rothman
M
0

There's no way to make the labeller task execute after the source control task. But you only need that if your label source data is exclusively stored in the local working directory. You said your label source is in version control, so you should use a labeller than can retrieve it from version control.

Most version control systems have a command-line that will allow you to read the file contents from stdout. CCNet labellers are easy to write and deploy. You can take in the command-line and arguments required to fetch the latest version info directly from the source.

Example ccnet labeller config

 <labeller type="svnLabeller">
   <svn>C:\Program Files (x86)\svn\bin\svn.exe</svn>
   <repository>https://path.to/project</repository>
   <versionInfoPath>/AssemblyInfo.cs</versionInfoPath>
  </labeller>
Mystique answered 16/11, 2013 at 12:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.