How do I invoke a publish profile in an automated TFS2017 build?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 04:43:31

问题


I have successfully upgraded to VS/TFS 2017, and I am at the point where I want the build to automatically publish a website to a staging location using one of the project's publish profiles. I am impressed with the flexibility in the "Build & Release" section of the TFS Team Project Site, but it's a little overwhelming.

This project has 2 simple publish profiles. Both use the 'FTP publish method' to upload to the Go Daddy hosting provider; one deletes all files before upload, the other only updates files. There are transforms applied for things like connection strings. These publish profiles work properly. I just need them to be added at the end of an automated build.

It would seem it should be simple to say 'use this publish profile', but there are so many options and choices it's not intuitively obvious which to use, and I haven't been able to find a reference on the web that focuses on what I want to do.


回答1:


If you want to invoke the msbuild command using the publish profile to publish website to FTP location, then it's impossible as FTP publishing is not supported on the command line.

If you insist on invoking the publish profile, then you can invoke msbuild command line with the publish profile used to publish the website to a staging location (eg, local or UNC path), then use FTP upload task step to upload the website from the staging location to the specific FTP location, or using PowerShell script to upload the website.

You can reference this thread: How can I add FTP website deployment to a VS2015/TFS2013 build process



来源:https://stackoverflow.com/questions/46457408/how-do-i-invoke-a-publish-profile-in-an-automated-tfs2017-build

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