Team Foundation Build Recipes

Deploying Web Application to IIS

Modified: 2008/02/11 17:23 by admin - Categorized as: Team Build Recipes
Edit

Description

This recipe provides the configuration for deploy a website to the Build Server IIS after completed a Build.



Edit

Software Requisites

Install Visual Studio 2005 Web Deployment Projects on Build Server

Download: Visual Studio 2005 Web Deployment Projects

Or

Install Visual Studio 2008 Web Deployment Projects on Build Server

Download: Visual Studio 2008 Web Deployment Projects



UnZip PSTools on Build Server at "c:\PSTools"

Download: PSTools



Edit

Other Requisites

Shared Folder on the Target Server

Example: \\TargetServer\BuildDeploy\



Administrator Rights for the Build Server Account on the Target Server



Edit

Preparation

1.- Add a Web Deployment Project to your Web Site.

Reference: VS 2005 Web Deployment Projects



2.- Add a Web Setup Proyect.

Configure in the File System Editor, Add a new "Project Output" under the folder "Web Applicator Folder" and select as project the "Web Deployment Project" created before.



3.- Create a new Build Type and make sure that run under "Release|Mixed Platforms".



4.- In the "Configuration Manager" window, create a new configuration named "Deploy".

Select all the Projects for Build including the Web Deploy Project and the Web Setup Projects.



5.- Run the Build Type.

At this point the build should succeed with no problems.



Edit

Usage

Open the "TFSBuild.proj" of the Build Type and add the script at the bottom of the file, before the "</Project>" tag.



Edit

Script



<Target Name="AfterCompile">

    
    <Exec Command="&quot;$(VSINSTALLDIR)\Common7\IDE\devenv&quot; &quot;$(SolutionRoot)\Application\Application.sln&quot; /build &quot;Deploy|Mixed Platforms&quot;" />

    
    <Copy SourceFiles="$(SolutionRoot)\Application\WebSetupProject\Deploy\WebSetupProject.msi" DestinationFolder="$(OutDir)" />

    
    <Copy SourceFiles="$(OutDir)\WebSetupProject.msi" DestinationFolder="\\TargetServer\BuildDeploy\" />

    
    
    
    <Exec Command="&quot;c:\PSTools\psexec&quot; \\TargetServer /accepteula MSIExec /x &quot;SETUP-PRODUCT-CODE&quot; /qn" IgnoreExitCode="true" ContinueOnError="true" />

    
    <Exec Command="&quot;c:\PSTools\psexec&quot; \\TargetServer /accepteula MSIExec /i &quot;\\TargetServer\BuildDeploy\WebSetupProject.msi&quot; /qn" />

</Target>



Edit

Source

This build recipe was made by Juan José Karam - The Sharp Code.



Edit

Notes

If you have any problem or questions about this Build Recipe you can post me a comment at The Sharp Code.



Edit

Disclaimer

This build recipe is provided "AS IS" without warranty of any kind.

© 2008 William Bartholomew blog.bartholomew.id.au

Powered by screwturn wiki