views:

308

answers:

6

With subversion or TFS, how would you go about setting up automatic builds?

I need some guidance with regards to naming convention and how this would happen automatically.

I am using /branches /trunk /tags folder structure. I am using a build app (finalbuilder).

Which tag name would I tell it to pull from (or revision # etc)? Since it is going to change all the time, how do people perform nightly builds? Using the date in the name of the release?

+5  A: 

Just use the revision number. Something like CruiseControl.NET should make this pretty easy for you.

Jon Skeet
I agree with Jon. CruiseControl.NET is great!
Peter Mourfield
why did you link to to logo? :)
Blankman
Um, 'cos I grabbed the link on the main page. Doh. Fixing.
Jon Skeet
A: 

I would set up the build server to monitor the /trunk folder and trigger a build whenever anything is commited there. If wanted, you could have the build script end with creating a tag for the build (even though that might be a bit ambitious, depending on how often things are commited to the trunk). When I have done that I have usually included the subversion revision number in the tag name, and also in the version number of the files (to the extent that this is applicable).

Fredrik Mörk
A: 

You should be able to pull right from the /trunk (and possibly with other nightly builds from branches that you think are important). It's not particularly useful to do a nightly build from a tag, since generally tags are static. When it is checked out, you can identify the checkout by the revision number that was checked out. That way if you ever need to find out what has changed since then, you can diff from that revision (or branch, whatever).

Adam Batkin
+4  A: 

Use TeamCity, setup a separate build for trunk + every branch. We do this and it's very helpful.

ripper234
(TeamCity makes it super easy to setup multiple build projects)
ripper234
A: 

We use Hudson, which checks periodically (set by you) for changes to whatever svn path you give it. It then has the ability to run a shell script (we are building for iPhone so use xcodebuild, but you could use whatever is used for ASP.net). We then upload the results of this to our local server under $REVISION. It would be easy to run automated tests in this as well.

Steven Canfield
A: 

Since you are asking about TFS:

We are using a CommonAssemblyInfo to increment the version of the dlls. Nightly Builds are typically from a trunk.

We have a Main-Folder from which a "Dev" Folder is branched for the current release. We make nightly builds from the current Dev-branch and manual, so called reference builds once we merge Dev-stuff back into Main. Builds are defined via the Build Agent stuff. Custom Tasks like incrementing version number enter the game via MSBuild.

flq