Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automating builds from subversion tags

I'm trying to automate the build process for engineering group. As part of that automation, I'm trying to get to a point where the act of applying a specific tag that adheres to a pattern will kick off an automated process that will do the following:

  • Check out source code
  • Create a build script from a template
  • Build the project

I'm pretty certain I could do this with a post-hook in subversion, but I'm trying to figure out a way to do this with something other than a subversion hook.

  • Would it make sense to monitor the tags directory in the subversion repository to kick off my workflow?
  • Are there any decent tools that help with this (.NET would be great if possible).
  • Am I better off just writing an engine to do this?

My preferences:

  • Existing product that does all or part of this
  • If development work needs to occur, .NET is preferable
  • Works with Windows (we've got a Linux based repo, but builds all occur on windows)
like image 249
Ajaxx Avatar asked Feb 06 '09 19:02

Ajaxx


2 Answers

I've done this using Hudson. In the regular subversion checkout slot I have a checkout for the trunk:

http://dryad.googlecode.com/svn/trunk/dryad

Then as the first build action, I have an "execute shell" and in that shell use a svn switch to change to the latest tag in the repository:

svn switch http://dryad.googlecode.com/svn/tags/'svn ls http://dryad.googlecode.com/svn/tags | tail -n 1' dryad

The next build step is a maven 'clean install' command that starts the build using the code from the tagged version.

I haven't figured out yet how to get Hudson to start with a latest tagged version rather than having to do the switch, but the switch works. You can then have the trigger be when the tag directory is updated.

It's automated... a bit of a kludge, but it works...

the switch should include a backtick for the second svn command but had to use ' because the backtick didn't show up here.

like image 131
ksclarke Avatar answered Nov 02 '22 06:11

ksclarke


I like hudson - EASY to set up and works out of the box with SVN.

You can configure it to build on every commit.

I downloaded it and got started building with it within a day. It has gone through a lot of tweaks, but I would recommend it to anyone.

I have also used cruise control but am not as happy with that. I don't have any specific reasons other than cross-platform issue.

EDIT

I recently added a job on my hudson build server that listens for a google/gmail jabber chat. I can "promote" a "regular" build to a release build with this mechanism. I just set up a new job that does the steps necessary to promote/publish a private build into a release candidate.

like image 25
Tim Avatar answered Nov 02 '22 08:11

Tim