Planning a daily, automatic build - ISerializable - Roy Osherove's Blog

Planning a daily, automatic build

One of the tasks I'm facing at a project these days is coming up with a automatic build configuration for the project. the idea is having a “daily build” for an existing project which comprises of roughly 110 sub projects (imagine loading that solution in vs.net!).
It is quite fun. Like solving a big puzzle.
Here's a little about what I envision. Feel free to comment.
 
The tool:
The automatic build tool that we Will be using is FinalBuilder. It has roved itself in many areas I've seen, including some of the most respected members in the community that use it on a daily basis.
Why not the free tools out there?
Let's face it - MSBuild, NAnt and all their friends, unless I'm mistaken, are pretty sucky in the visual development and maintenance department. I made a promise to myself I won't do manual XML editing unless I am forced to by gun point or a salary decrease. Neither has happened. yet.
 
The architecture:
A build server
A source control server
A backup server
A testing server
A staging environment (multiple machines imitating the machines at the production location)
A remote staging environment(less machines but more similar security restrictions).
 
In broad strokes a daily build would mean:
The build server takes out all source control from source  control
build it all (including all versions, debug and release)
Back up to zip files using incremented version ,date and time into the backup server
Deploy automatically onto the testing machine all the part of the distributed application in question, allowing the team to run smoke test on the built application.
 
However, there are more processes.
After smoke testing and more rigorous tests, another automatic script will deploy a version into the staging server.
It Will use the backed up zip files from the back up server for this.
Load testing and others will performed on the stating servers.
 
After that another automatic deployment will take place - onto the remote staging servers.
These serves sit in the same place as the real production ones, and so enjoy the same security benefits , meaning we can test what happens behind the real firewall and active directory and all that. Once tests have passed there, we can use another auto deploy into production.
 
These are the basic steps. It's pretty fun planning this, kinda like building your own big ant farm.
 
One of the biggest issues we are facing and still haven't solved is this: Databases.
In many cases, making a new release might mean just a few changes on the database data, and nothing more.
There needs to be a way to get just those changes from the dev DB and into the test DB, automatically.
It gets a little tricker. We also want the database to be backed up along with each version's source files into the backup server. A binary backup will do in some cases (multiple databases here, but some databases need to be retained only in schema and not in binary form.
certainly this will prove to be the biggest challenge in this process.
I'd be interested to hear how other people get around this problem.
Published Friday, June 04, 2004 2:30 PM by RoyOsherove
Filed under:

Comments

Friday, June 04, 2004 8:31 AM by Darren Neimke

# re: Planning a daily, automatic build

Keep us posted with your progress on this Royo - I'd love to hear how you tackle it and what solution you end up with. I've got a ~70 project solution which I need to build so, I have a similar problem to yours.
Friday, June 04, 2004 8:39 AM by Karl

# re: Planning a daily, automatic build

Just to give my $0.02, I just started playing with a build/automated testing for here at work (they'll never adopt such procedure of course)...and felt way strong against using nAnt for the reasons you mentioned. But I gave it a try and it was a real breeze. Within 1/2 a day I have the project building automatically (source/debug/stage) with nUnit test cases running against the builds. Of course this was for a single project :)

However, something I didn't try doing was using nAntContrib's <slighshot> task to convert a .sln to a nant build file. If <slingshot> works as straightforward as all the other nant tasks, I'd highly recommend it.
Friday, June 04, 2004 9:10 AM by Justin Pitts

# re: Planning a daily, automatic build

Are you using the Visual Studio database project to maintain your database schema scripts? If not, maybe thats something to look into. Otherwise, make a habit of always saving database changes as change scripts. Keep them centrally located, and write a little utility (or .cmd file using "for /F ..." ) that iterates over all the change scripts and executes them with osql (or the equivalent for your db if not MSSQL).

I've often thought about, but never decided - for each "version" (schema change) of the database, should I just maintain the change scripts, or should I also reverse engineer the create scripts for the entire DB? Hmmm.... The answer is somewhere in between I think.
Friday, June 04, 2004 1:38 PM by David

# re: Planning a daily, automatic build

Sounds like an exciting challenge! We recently set up an automatic daily build process as well, using <a href="http://www.visualbuild.com">Visual Build</a> as our "master build" tool. Our build process doesn't involve actual deployment to staging servers and the like, but the software build is fairly involved, with multiple product lines and localized builds. Anyway, I'm interested in hearing of your Further Adventures :).
For DB upgrades, new-DB creation will use the updated schemas, but we'll have to use separate upgrade data for in-place database upgrades. In an Ideal World, we'd be able to automatically generate the upgrade scripts from the old->new diffs, but that's not very likely in a realistic timeframe ;).
Friday, June 04, 2004 1:39 PM by David

# re: Planning a daily, automatic build

Sure would be handy if there were an indicator, down here in this comment area somewhere, as to whether or not HTML is supported in comments ;).