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

5 comments
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

Thx. I will give it a shot later.

0

Please sign in to leave a comment.