MSBuild 删除不需要的文件

发布于 2025-01-01 10:21:12 字数 301 浏览 3 评论 0 原文

我使用 TeamCity 运行 MSBuild 来部署我们拥有的 .NET 网站。该网站使用 Sitecore CMS,其中包括三个文件夹、数百个文件(和 mbs),这些文件必须位于主网站根文件夹中。

目前,MSBuild 在将自身部署到其中之前会删除整个 Web 根文件夹。这会导致两个问题:

1) 在部署过程中约 2 分钟内无法访问我们的 CMS 2)实际部署需要很长时间,因为部署后我们必须运行批处理脚本将所有这些文件复制到 Web 目录中。

有没有办法让 MSBuild 在部署之前不清除整个根目录,或者让它忽略某些文件夹?谢谢!

I use TeamCity to run MSBuild to deploy a .NET website we have. The site uses the Sitecore CMS, which includes three folders, a few hundred files (and mbs) that have to bee in the main website root folder.

Currently, MSBuild deletes the entire web root folder before deploying itself into it. This causes two problems:

1) Our CMS is not accessible during the ~ 2 minutes it takes to deploy
2) The actual deployment takes long because we have to run a batch script to copy all of those files into the web directory after deployment.

Is there a way to have MSBuild not clear the whole root directory before deployment, or have it ignore certain folders? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流年里的时光 2025-01-08 10:21:12

我有同样的问题,尽管我发现有一个您可以在 MSDeploy 上使用“skip”设置来执行此操作。

看起来 MSDeploy 命令在 MSBuild 中工作,我并没有领先你太多。

我需要删除除 2 个目录之外的所有目录,然后复制其余目录。如果您取得了进展,请告诉我。

I have the same question, although I have found there is a 'skip' setting you can use on MSDeploy to do just this very thing.

Seemingly MSDeploy commands work in MSBuild I am not the much further ahead of you.

I need to delete all except for 2 directories, and copy the rest across. Let me know if you've made progress.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文