简体   繁体   English

Azure DevOps 管道即代码和部署组

[英]Azure DevOps Pipeline as Code and Deployment Group

I'm facing the challenge to use the same resource (VM in my company) for all my dev environment.我面临着为我的所有开发环境使用相同资源(我公司中的虚拟机)的挑战。 That means that multiple apps will be deployed there.这意味着将在那里部署多个应用程序。

I have: https://dev.azure.com/mycompany/project1 with a Pipeline as Code for CI/CD & environment called D-Stage我有: https://dev.azure.com/mycompany/project1有一个管道作为 CI/CD 和环境的代码,称为 D-Stage
https://dev.azure.com/mycompany/project2 with a Pipeline as Code for CI/CD & environment called D-Stage https://dev.azure.com/mycompany/project2管道作为 CI/CD 和环境代码 D-Stage

Since I can't use Deployment group, each time I register the VM as a Resource of each project's pipeline, if I don't change the registration name, one reg replace another and the last registration is the only one that has connection to the VM.由于我不能使用部署组,每次我将虚拟机注册为每个项目管道的资源时,如果我不更改注册名称,一个注册会替换另一个注册,并且最后一个注册是唯一与虚拟机。 On the other side if I create a new registration I get a new azure agent per project.另一方面,如果我创建一个新注册,我会为每个项目获得一个新的 azure 代理。

What should be the right way to handle the scenarios since Deployment Group is not supported in YAML files?由于 YAML 文件不支持部署组,因此处理这些场景的正确方法应该是什么?

If we want to add multiple resources in a VM environment, and the resources refer to the same VM, we need to modify the agent name in the registration script, otherwise the resource with the same agent name will replace the previously registered resource.如果我们要在一个VM环境中添加多个资源,并且这些资源引用同一个VM,我们需要在注册脚本中修改代理名,否则代理名相同的资源会替换之前注册的资源。

By modifying the agent name( --agent $env:COMPUTERNAME ) in the registration script, we can register multiple agents in a VM environment:通过修改注册脚本中的代理名称( --agent $env:COMPUTERNAME ),我们可以在一个VM环境中注册多个代理:

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

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