Tuesday, November 30, 2010

How to automatically deploy, once Gated checked-in

Solution 1 : Based on Web deploy package
* Create a Web deploy package
* Add extra MSBuild parameters onto the BuildDefinition (such as  /p:CreatePackageOnPublish=true /p:DeployOnBuild=true)
and http://weblogs.asp.net/jdanforth/archive/2010/04/24/package-and-publish-web-sites-with-tfs-2010-build-server.aspx
or http://publicityson.blogspot.com/2010/11/tfs-2010-build-and-deploy-with-web.html

Then, once you run and passed the Gated Check-in (or in fact, any TFS Build), you will find all the codes be be installed in the TFS "Drop folder".

Solution 2 : Run a Batch file with the Build definition Workflow :
To do so, you have to use InvokeProcess activity with the Workflow TFS 2010 - how to execute a batch file after build
For more details, see my other post : http://memoprojects.blogspot.com/2010/12/create-custom-workflow-for-tfs-2010.html

Solution 3 : A more "industrialized way" is to use WIX to generate your MSI
First, we have to understand how it works (Ewald Hofman is MVP VS ALM) before specifically use WIX.

Then, you should understand MSBuild ; here are the basics from the MSDN : "Compile Apps Your Way With Custom Tasks For The Microsoft Build Engine"

Finally, use this VERY detailed tutorial "Automate Releases With MSBuild And Windows Installer XML" (MSDN Mag).

Note: Here is a Hello World that will launch Notepad with a new HelloWorld.txt file after the Build,
we first start to create a MSBuild project, for instance mySmallProject.csproj

in which you can find :
 <Target   Name="AfterBuild"
             <Exec   Command="C:\WINDOWS\notepad.exe HelloWorld.txt" />

Then the command line :
          msbuild.exe mySmallProject.csproj /t:Build
will build and at the end, it will open your NotePad !

Solution 4: Use TFS Deploy
http://tfsdeployer.codeplex.com/ but this project has only 140 downloads as per today (dec 2010).

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.