Reputation: 4667
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..
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
Upvotes: 2
Views: 1137
Reputation: 27904
Code should not go from a developer's box to a deployment server. It should go from source control via a CI (like CruiseControl.Net) to your deployment environment.
If you put the majority of your build logic in a .proj file, if you ever swap out from CC.NET to another CI tool, the amount of effort to do this is minimal. Using the above, you only need to swap the pulling of the source-control files and the handful of publish events (CC.NET proprietary tasks). The .proj file will transfer to to other CI tools. We went from CC.NET to TFS and because I had this forethought, the change was minimal. If I had used CC.NET specific tasks instead of .proj, the changeover would had been painful.
http://mikefourie.github.io/MSBuildExtensionPack/
and
https://github.com/loresoft/msbuildtasks
have alot of extra functionality. Most msbuild needs have been coded up by somebody out there.
And if push comes to shove, you can always create a custom msbuild task. But that is rare these days.
There is the basic outline.
Upvotes: 0
Reputation: 44342
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.
Upvotes: 6
Reputation: 55172
-- 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.
Upvotes: 0