简体   繁体   English

模块化.net应用程序的章鱼部署方法

[英]Octopus Deploy approach for modular .net applications

We have a .NET windows service which doesn't have any direct assembly references, but checks the local directory for assemblies (via StructureMap) to load additional behaviour into the system. 我们有一个.NET Windows服务,它没有任何直接的程序集引用,但是(通过StructureMap)检查程序集的本地目录以将其他行为加载到系统中。

Each module which can be pushed into the local directory lives as a nuget package in a private nuget repo. 可以推送到本地目录中的每个模块都作为nuget包存在于私有nuget存储库中。

Looking at deployments, there are two approaches and I'm keen to understand how other people have approached this and whether they'd recommend this approach with hindsight: 从部署的角度来看,有两种方法,我很想了解其他人是如何采用这种方法的,以及他们是否会事后建议采用这种方法:

  1. Create an entry-point application which references the necessary module nuget packages, then create a nuget package for the entire application and use Octopus to deploy this 创建一个引用必要模块nuget包的入口点应用程序,然后为整个应用程序创建一个nuget包,并使用Octopus进行部署。

  2. Use Octopus' ability to deploy multiple nuget packages and re-constitute everything in the deployment phase 使用Octopus的能力来部署多个nuget程序包,并在部署阶段重新构造所有内容

Many thanks in advance. 提前谢谢了。

Taking into account your libraries are loaded once on a service start-up, I would have probably opted for a one octopus project with multiple steps. 考虑到您的库在服务启动时会加载一次,因此我可能选择了一个包含多个步骤的章鱼项目。 As an example: 举个例子:

  1. Stop the service 停止服务
  2. Cleanup the libraries folder 清理库文件夹
  3. Deploy library1 部署库1
  4. Deploy library2 部署库2
  5. ..... .....
  6. ..... .....
  7. Deploy and run the service 部署并运行服务

The service deployment and installation to be the last step. 服务的部署和安装是最后一步。 That way you safely run all the steps in the deployment and your service should work off the dll's deployed to a folder. 这样,您就可以安全地运行部署中的所有步骤 ,并且服务应该可以将dll部署到文件夹中。

Another point to keep in mind, a deployment to a new/clean machine should result in the fully setup service (with all required libraries). 要记住的另一点是,部署到新的/干净的计算机上应该导致完全设置服务(带有所有必需的库)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM