在 CI 配置的源代码管理中应将部署脚本放置在哪里?

发布于 2024-11-19 23:53:14 字数 1004 浏览 6 评论 0原文

我正在开发一个分布式解决方案(用 .NET 编写),其中包括 WCF 服务、Windows 托管服务,并且依赖于其他本机和托管解决方案。该项目的主要目标是对另一个分布式系统进行各种测试。

在 TeamCity 中一键单击即可部署该构建。测试工具和测试的分布式系统的二进制文件位于共享文件夹中。为了部署这一切,我有一些 .bat 和 powershell 脚本,它们也位于共享文件夹中。我不断地处理脚本并且它们不断更新,所以我想将它们保留在源代码管理中。

存储部署脚本的可能位置是什么?

现在,我在解决方案中有一个专用文件夹,但我不太确定这是一个好方法。我还没有找到将脚本部署到每个 TeamCity 构建上的共享文件夹的方法。

/solution
   /app [test harness code]
   /test [unit, functional, integration, capacity tests]
   /deployment 
      /scripts [.bat and .ps1 scripts only]
         /TeamCity [copy binaries to share folder on TeamCity]
         /VM [scripts for installation of test harness and unit under test]

更新
我所说的部署脚本应该存储在 Team City 计算机上的共享文件夹中。在测试场景中,多个虚拟机将这些脚本复制到本地文件夹,然后执行它们。根据脚本和 VM 分配,不同的二进制文件将复制到 VM 并执行不同的安装。脚本通常是< 100 行,但各个组件差异很大,并且不断更新。

我将脚本存储在没有 .csproj 文件的 Visual Studio 解决方案文件夹中,因此当 Team City 从存储库中检出代码时,它们不会被复制,因此我无法将它们复制到共享文件夹。

I am working on a distributed solution (written in .NET) that includes WCF services, Windows managed services and has dependencies to other native and managed solutions. The primary goal of the project is to perform various testing of another distributed system.

The build is deployed with one click in TeamCity. The binaries of test harness and the tested distributed system go to the shared folder. To deploy it all I have a few .bat and powershell scripts which also live in the shared folder. I constantly work on the scripts and they get updated, so I want to keep them in the source control.

What are the possible locations to store deployment scripts?

Right now I have a dedicated folder in the solution, but I am not too sure this is a good approach. I haven't figured out the way to deploy scripts to the shared folder on each TeamCity build.

/solution
   /app [test harness code]
   /test [unit, functional, integration, capacity tests]
   /deployment 
      /scripts [.bat and .ps1 scripts only]
         /TeamCity [copy binaries to share folder on TeamCity]
         /VM [scripts for installation of test harness and unit under test]

UPDATE
Deployment scripts I am talking about should be stored in a shared folder on the Team City machine. In the testing scenarios several VMs copy these scripts to the local folders and then execute them. Depending on the script and VM assignment, different binaries are copied to the VM and different installations performed. Scripts are usually < 100 lines but are quite different from component to component and are constantly updated.

I store scripts in a Visual Studio solution folder without the .csproj file, and thus they are not copied when Team City checks out the code from repository, and thus I cannot copy them to the shared folder.

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

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

发布评论

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

评论(1

屌丝范 2024-11-26 23:53:14

对我来说看起来不错。如果我要执行持续集成,我通常会做类似的事情。

编辑:我刚刚注意到有关将脚本部署到共享文件夹的部分。你到底是什么意思?您的脚本也受到源代码控制吗?

Looks fine to me. I usually do something similar if I will be performing continuous integration.

Edit: I just noted the part about deploying scripts to the shared folder. What do you mean exactly? Are your scripts also under source control?

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