Thursday, April 28, 2011

Silverlight application deployment - Part 3

From the previous posts,these are the steps

1. Install prerequisites for deploying through TFS
2. Deploy the silverlight application
3. Configuring IIS
4. Database configuration

We'll cover

2. Deploy the silverlight application

a. Create Virtual Directory in IIS
b. Creating build definition in TFS for automated deployment
c. Trigger build deployment



a. Create virtual directory in IIS

1. Start->Run--> Type Inetmgr



2. Right click on default website-->New--> Virtual Directory



3. The Virtual Directory wizard opens. Click ‘Next’



4. Enter the name of the virtual directory. - Project1. Notice that this should correspond to the Virtual directory path you mention above in the build arguments. ie. Default Web Site\Project1



5. Click “Next” and enter the path of the content directory. This is the folder where the actual files will be stored.



6. Click “Next” and give "Read" and "Run Scripts" permissions. Click Next to finish.



b. Creating build definition in TFS for automated deployment

Before triggering deployment, we need to create a build definition in TFS which contains the application path and other required parameters which will be used to do deployment. Some of the parameters are, the path in IIS where the application should be deployed. The login credentials of the remote machine and so on.

Steps:

Open Visual Studio


Connect to Team Foundation Server --> to the project
Click on New build definition


Enter any name for the build definition


Select the trigger options. (information regarding, When you want the build to be deployed)


Select the build controller. This should be installed when setting up TFS. Also specify the location where the build should be copied to.


Enter the path of the solution file


In the advanced tab, Enter the MSbuildArguments
The mandatory arguments are follows

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MsDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=http://10.13.13.11 /p:DeployIISAppPath="Default Web Site/Project1" /p:username=webdeploy /p:password=pass38930!

p:MsDeployServiceUrl denotes the remote machine ip
p:username and password are the login for webdeploy account
p:DeployIISAppPath is the path in IIS where you want the Virtual Directory to be created.


Save the build definition.

c. Trigger build deployment

Right click on builds --> queue new build and select the build definition you created

No comments:

Post a Comment