.net - Capturing output from an 'exec' task in CruiseControl.NET -
i'm using cruisecontrol.net build , version code (format: major.minor.build.revision). revision version component, used use svn revision number. we're switching git, uses sha-1 hashes instead of revision numbers. after quick internet search, discovered can count of commits following command:
git rev-list head --count
this command prints number stdout, exits. information need, how capture output in ccnet?
so far, have this:
<tasks> <exec> <executable>git.exe</executable> <buildargs>rev-list head --count</buildargs> </exec> <msbuild> ... </msbuild> </tasks>
redirect git command file.
git.exe rev-list head --count >myrevision.txt
then use filelabeller in cc.net project configuration.
<labeller type="filelabeller"> <labelfilepath>myfolder\myrevision.txt</labelfilepath> <prefix>foo-</prefix> <allowduplicatesubsequentlabels>true</allowduplicatesubsequentlabels> </labeller>
reference: http://cruisecontrolnet.org/projects/ccnet/wiki/file_labeller
Comments
Post a Comment