views:

533

answers:

2

I could do with some pointers, code examples or references that may help me do the following in an msbuild file to help speed up the deployment process..

This scenario involves getting a developers 'local' version onto a 'development' server..

  1. Increment a developers local Web Applications Assembly version number
  2. Publish a developers local Web Application files somewhere
  3. .rar the publsihed files or folder into the format v[IncrementedAssemblyNumber].rar
  4. Copy the .rar to somewhere
  5. Backup (.rar) the existing live website folder (located elsewhere) in the format Pre_v[IncrementedAssemblyNumber].rar
  6. Move the backed up .rar to a /Backup folder.
  7. Overwrite the development web files with the published local web files

Should be simple for all those MSBUILD Gurus out there.

Like I said, answers or 'Good and applicable' links would be much appreciated.

Also i'm thinking of getting one of the MSbuild books. From what I can tell there are 2, possibly 3 contenders. I am not using TFS. Can anyone recommend a book for beginning MSBUILD? Ideally from people that have read more than one book on the subject.

Cheers,

-- Lee

A: 

-- Edit: Assuming you're using .NET ...

Use NAnt, and use NAnt Contrib you call MSBuild. This will give you a basic system :)

-- Edit

You should, of course, also get yourself a CI server, such as CruiseControl.NET, and hook it up to a source control system, like SVN, and then do your builds on that.

Noon Silk
Cheers silky. We have CCNET. I will look into your suggestion. -- Lee
Lee Englestone
FWIW, I'm also working on (as we speak, in fact) an auto-deployment system: http://www.mirios.com.au/dashy/ (currently free for download). Feel free to give it a crack (or wait a few weeks, till I officially make it public).
Noon Silk
+4  A: 

Hi, I think for the build part you of course should use MSBuild. For the deployment aspect you might want to take a look at the Microsoft Web Deployment Tool (MSDeploy). It supports backing up websites (via .zip files) and updating. What I would do is to create an MSBuild file which will call into MSDeploy. Also PowerShell would be a good driver which calls MSDeploy. You can do the same tasks with MSBuild alone but it will be more difficult.

The aspect of your post that makes me wonder is your reference to "a developers local web ...". If it is possible you should have a build server which is responsible for creating all of your products which are going to non dev environments. As someone mentioned a good free CI server is CruiseControl.NET.

About books you can take a look at mine Inside the Microsoft Build Engine:Using MSBuild and Team Foundation Build. If you are not using TFS (and therefor Team Build) it's ok. The chapters on MSBuild ( 9 out of 12 ) are independent of TFS.

Sayed Ibrahim Hashimi
Cheers Sayed. We are indeed using CCNET.Your book is on my Amazon Birthday wishlist. Is that sad?-- Lee
Lee Englestone