dump Build number/svn version number to a text file
Hi!
I will like to have svn version or Build number as part of my artifact. So, is there any way to dump it to a text file during/after a successful build?
I can use SubWCRev to get the revision number on my local machine. But since Teamcity's working dir not have .svn dir. That command won't work.
Any suggestion here???
Gen
Please sign in to leave a comment.
just figure it out by changing VCS checkout mode to Automatically on agent. SO, I can preserve .svn folder which have all info I need
Gennan,
TeamCity does put this kind of information into some predefined properties when it runs a build:
http://www.jetbrains.net/confluence/display/TCD4/Predefined+Properties
If you're using some kind of build script such as NAnt, you could pick up the build number/VCS rev from one of these properties and write it out to a text file.
Just a thought...
Cheers,
Andy
Hi!, Andy,
I am using MSbuild. But I am wondering can I have a script at the end of the build to grep those enviroment variable and dump them into a file. Do u have any exmaple from nant for this ?
Thx.
Gen
Hi Gen,
I don't know much MSBuild but in NAnt you could write the build number out to a file using something like:
<echo message="Build number is ${build.number}" file="BuildNumber.txt" />
TeamCity sets the build.number property for you automatically. No need for any grepping!
Andy
Thx. I will give it a shot later.