thinking in geek tagline’s are so web2.0

google
yahoo
bing

Posted
2 January 2008 @ 11pm

Tagged
architecture, deployment

Crappystrano

Note: After I started this series Jeremy Miller has posted a very relevant article about source code hygiene issues.

(This is the third part in a series – you should probably read part one and two first.)

Today I’ll present a sanitised copy of my deployment script. I’ve based the design of deploy.cmd on Capistrano1 . The script is nicknamed “Crappystrano”. Here’s the output (pretty htmlized source is here):

>deploy.cmd

Crappystrano – the shit script which (sort of) deploys stuff

deploy.cmd staging|live [branchpath]

Here’s breakdown of the steps2 – skipping some error checking3. :

  1. Do we have the required dependencies4 on the path? If we don’t copy them to the path if they’re just 1 exe – otherwise exit with an error.
  2. Check the command line parameters. We must have the environment we’re releasing to? Are we releasing from the trunk or from a SVN branch?
  3. Construct a release time stamp. This is YYYYMMDDHHMMSSMS.
  4. Perform a “svn export” from the trunk/branch to %tmp%\staging|live%timestamp%. [E]
  5. Use msbuild to build the solution. [E]
  6. Rearrange the folder structure so we only get the artefacts we need in the release package.
  7. Zip up the release package using the environment name + time stamp.
  8. move the release package back to the root directory of the project and delete the export from %tmp%.
  9. Make a SVN tag (svn copy trunk/branch /tags/environment-timestamp).

I’ve uploaded a zip file with the script and folder structure + a little readme. This is not the best way of doing things – it’s just a very lightweight way. Comments, questions, feedback etc… are gratefully received.

  1. http://www.capify.org/ – I know some people are going to say – just use Capistrano. There are two reasons for me not to: 1. I’m the only person in my team familiar with Ruby. 2. Even if you argue that they don’t need to understand ruby to run a cap deployment recipe – they still have to have it installed. It’s just yet another dependency which I’m not willing to take currently. []
  2. This is all simplified as the actual script supports a SaaS product which has multiple instances – one per client []
  3. noted with [E] []
  4. gnu zip.exe, svn []

No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment