Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Deployment through MSDeploy.exe

I'm configuring a CI build server with Jenkins. After the build steps I'd like to deploy the website.

When publishing the the website from VisualStudio I published by Web Deploy. I like that method because it actually publish those file which have changed, so the deploy is really quick.

Now on the build server I'm trying to do the same: build the application (using MSBuild.exe), and then deploy the application (using MSDeploy.exe?).

I've seen some post where they deploy the application using MSBuild.exe and others using MSDeploy.exe, is there a significant difference in there?

Do you have any advice that could help with this?

Thanks and advanced.

like image 319
Abraham Duran Avatar asked Mar 24 '16 01:03

Abraham Duran


People also ask

What does MSDeploy exe do?

Overview. Web Deploy (msdeploy) simplifies deployment of Web applications and Web sites to IIS servers. Administrators can use Web Deploy to synchronize IIS servers or to migrate to newer versions of IIS.

Can I uninstall Microsoft web Deploy?

In general, it is recommended to uninstall Microsoft Web Deploy by using the Add/Remove Program feature in the Control Panel. This error may occur if related installation file/registry is missing or damaged.


2 Answers

Use MSBuild to create an MSDeploy package and then MSDeploy.exe to deploy that package to any environments. This link should help you gain a better understanding of how WebDeploy/MSDeploy works.

http://dotnetcatch.com/2016/02/25/the-anatomy-of-a-webdeploy-package/

Whats REALLY cool is you can also use MSDeploy to deploy databases and non-web applications too. We have fully automated the deployment of 50+ products using this method.

http://dotnetcatch.com/2016/02/10/deploying-a-database-project-with-msdeploy/

http://dotnetcatch.com/2016/03/18/deploy-non-web-apps-with-msdeploy/

UPDATED - Basic steps to use MSDeploy packages:

  1. Create a package in your build by adding the /t:Package arg to your MSBuild call
  2. Store the resulting package form the bin directory to your artifact repo
  3. Call MSDeploy.exe to deploy the package to your target server. There are lots of options here but the basic command follows:

    "c:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package=mypackage.zip -dest:auto,computerName=localhost

like image 118
chief7 Avatar answered Oct 14 '22 05:10

chief7


Even easier using current Visual Studio and dotnet, create your Publish Profile in Visual Studio, then use dotnet on the CI server:

dotnet publish /p:PublishProfile=PROFILE-NAME /p:Password=*****

https://github.com/aspnet/Docs/blob/master/aspnetcore/host-and-deploy/visual-studio-publish-profiles.md

like image 30
Auspex Avatar answered Oct 14 '22 03:10

Auspex