Build and Deploy a Web Application with TFS 2015 Build

核能气质少年 提交于 2019-11-29 22:29:46

We use "Visual Studio Build" step and as Arguments for MSBuild we use following line:

/p:DeployOnBuild=True /p:PublishProfile=$(DeploymentConfiguration)

On Variables tab page DeploymentConfiguration has to be configured. It must be the Name of the publish Profile (filename of the pubxml file). If the file Name is Build.pubxml the publish profile is Build.

for example:

/p:DeployOnBuild=True /p:PublishProfile=Build

I wanted to add that Ben Day has an excellent write-up that helped us package quickly and then release to multiple environments through Release Manager.

His msbuild arguments look like this:

/p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=$(build.artifactstagingdirectory)\for-deploy\website

The difference between this and the accepted answer is that this parameter set stages everything in an artifacts folder, and then saves it as part of the build. We can then deploy exactly the same code repeatedly.

We capture the web.env.config files alongside the for-deploy folder and then use xdt transforms in the release process to ensure everything gets updated for whichever environment we're deploying to. It works well for all our web projects.

We use WebDeploy/MSDeploy for 40+ applications and love it. We do install WebDeploy on all our servers so we can deploy more easily but you could also use the Web Deploy On Demand feature which doesn't require WebDeploy be pre-installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!