Auto Deploy using Continuous Integration in TFS 20

2019-03-15 05:26发布

问题:

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?

回答1:

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???