Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto Deploy using Continuous Integration in TFS 2012

I have setup continuous integration for a WCF project and want to use the MSBuild Arguments to automatically deploy the application to a remote server but it is not deploying.

When running a new Build all the Tests pass and all the projects build but the website is not being deployed. Also, I am getting no errors back from the build to say anything has gone wrong.

I have opened up port 8172 on the remote server to ensure connections can be made to IIS and have even disabled the firewall.

In the Build Configuration I have specified the following arguments;

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:DeployIisAppPath="Default Web Site/MYSite" /p:MsDeployServiceUrl=http://mysite.com /p:username=MySite\Administrator /p:password=thePassword

I compiled this configuration from the following examples:

http://vishaljoshi.blogspot.co.uk/2010/11/team-build-web-deployment-web-deploy-vs.html

http://www.chrissurfleet.co.uk/post/2011/07/21/Setting-Up-Continuous-Deployment-In-TFS.aspx

I have configured the Server's IIS to enable remote connections and I can Remotely administer IIS from the build server. Also I have successfully deployed the Application using Visual Studio 2012 Publish option.

can anyone see a problem with my MS Build Arguments? Am I missing anything?

Any help would be very grateful

Update:

I have checked the build server to check MS deploy is installed and have installed Web Deploy 3.0 to ensure this is capabale, but has not solved my problem.

I have check the IIS connection logs to see if the remote connection to IIS is being made and there is no connection being made from my build server to the app server.

I have tried running MSBuild.exe for the solution and project on the build server manually with the following:

MSBuild.exe "Project Location" /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSVC /p:DeployIisAppPath="Default Web Site/app" /p:MsDeployServiceUrl=http://appserver:8172/MSDeploy.axd /p:AllowUntrustedCertificate=True /p:CreatePackageOnPublish=False /p:Username=username /p:Password=password

The MSBuild is successfully building the project but is making no attemp to deploy it.

Any Ideas?

like image 658
Andy Clark Avatar asked Sep 18 '12 14:09

Andy Clark


People also ask

Can TFS be used for continuous integration?

TFS is Microsoft's solution for continuous DevOps and has since been rebranded/renamed Azure DevOps Server. It has an in-built suite of tools that lets you achieve continuous integration and delivery with ease.

What is CI and CD in TFS?

Introduction. Continuous integration (CI) and continuous deployment (CD) help in reliably deliver quality apps to the customers at a faster rate. From code through build, test, and deployment is defined efficiently and fully managed pipelines that automate and control the entire process.


1 Answers

Turns out the problem was files were missing on the Build Server as desibried in the Answer to this question:

Similiar problem

Also when installing Web Deploy 3.0 using Web Platform installer not all the features required are installed in order to connect remotely to IIS through MSBuild command line.

I copied the nessesery files from my dev machine to the build server and installed Web Deploy 3.0 manually with all features and this now works!

Maybe there is a bug with TFS 2012???

like image 179
Andy Clark Avatar answered Oct 24 '22 04:10

Andy Clark