如何在每次部署 VSTS 之前清理目标 Azure 网站 Windows Server 上的 wwwroot 文件夹 [英] How to clean up wwwroot folder on the target Azure Websites Windows Server before each deployment in VSTS

查看:9
本文介绍了如何在每次部署 VSTS 之前清理目标 Azure 网站 Windows Server 上的 wwwroot 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大约十几个部署之后,由于活跃的开发和部署,wwwroot 目录中充满了大量文件.我们正在使用 VSTS 的 Azure App Service Deploy 任务为 ASP.NET Web API 项目部署到 Azure 网站 Windows Server,有没有办法在之前清理 wwwroot 目录部署到 Avsts 部署前清理?

After about a dozen deployments, the wwwroot directory is filled with a lot of files due to active development and deployments. We are using VSTS's Azure App Service Deploy task to deploy to Azure Websites Windows Server for a ASP.NET Web API project, is there a way to clean up the wwwroot directory before deploying to the Avsts pre-deployment clean up?

推荐答案

在使用 Azure 应用服务部署 任务时,并且您正在使用 发布使用Web 部署选项,还有一个附加选项可以删除目标位置的其他文件.

When using the Azure App Service Deploy task, and you are using the Publish using Web Deploy option, there is an additional option to Remove Additional Files at Destination.

如果选中此选项,部署过程将删除目标位置的所有文件,如果正在部署的包中没有相应文件.

If you check this option, the deployment process will remove any files at the destination where there is no corresponding file in the package that is being deployed.

换言之,它将从以前的部署中删除不再需要的任何剩余文件.

In other words, it'll remove any left over files from a previous deployment that are no longer required.

这篇关于如何在每次部署 VSTS 之前清理目标 Azure 网站 Windows Server 上的 wwwroot 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆