[英]Azure Devops : YAML Pipeline for independent Deployment of Single Tenant .Net MVC App for different clients
I need suggestions for creating a YAML pipeline for the independent deployment of the Single Tenant.Net MVC App for different clients.我需要有关为不同客户端独立部署 Single Tenant.Net MVC 应用程序创建 YAML 管道的建议。
If you can guide me about the following points.如果你能指导我以下几点。
Generally, if you want to deploy to different environments, you can set up a stage for each environment in a pipeline.一般来说,如果你想部署到不同的环境,你可以为管道中的每个环境设置一个阶段。 However, considering that you have 150+ different configurations, it is so torturous to set up 150+ stages in the pipeline.
然而,考虑到你有 150+ 种不同的配置,在流水线中设置 150+ 个阶段实在是太折磨人了。
If all the deployments have the same deployment steps (same scripts, same input parameters), but different values of the input parameters, you can try using Multi-job configuration (the Matrix ) in the pipeline.如果所有部署都有相同的部署步骤(相同的脚本,相同的输入参数),但输入参数的值不同,您可以尝试在管道中使用多作业配置( 矩阵)。
With this way, you do not need to set up a stage or a job for each configurations, you just need to set up a stage or a job with all the common deployment steps.通过这种方式,您无需为每个配置设置阶段或作业,您只需设置具有所有常见部署步骤的阶段或作业。 But you need to enumerate all the configurations (150+) you require.
但是你需要列举你需要的所有配置(150+)。 When running the pipeline, it will generate 150+ matrix jobs with the same deployment steps but different values of the input parameters.
运行管道时,它将生成 150 多个矩阵作业,部署步骤相同,但输入参数的值不同。
[UPDATE] [更新]
Just curious, in this case of multi-job configuration, all the 150+ installations will be triggered in one go, right?
只是好奇,在这种多作业配置的情况下,所有 150 多个安装都将在一个 go 中触发,对吧?
After the pipeline run is triggered, all the 105+ matrix jobs will be triggered and be in queue.触发流水线运行后,将触发所有 105+ 个矩阵作业并排队。 However, normally not all the 150+ jobs will be started up to run in parallel at the same time.
但是,通常不会同时启动所有 150 多个作业以并行运行。 It depends on the
maxParallel
you set and how many available agents can be assigned to the run.这取决于您设置的
maxParallel
以及可以为运行分配多少可用代理。
I can't select the way, where deployment is started for let's say 5 of the client only.
我不能以 select 的方式开始部署,假设只有 5 个客户端。
If you want that the deployment can be executed firstly for some clients and then for other clients, you can try using stages.如果您希望可以先为某些客户端执行部署,然后再为其他客户端执行部署,您可以尝试使用阶段。
For example, in stage_1
, execute the deployment job (multi-job configuration) for the first 5 clients.例如,在
stage_1
中,为前 5 个客户端执行部署作业(多作业配置)。 After stage_1
, start up stage_2
for another several clients, then stage_3
for other clients, etc..在
stage_1
之后,为另外几个客户端启动stage_2
,然后为其他客户端启动stage_3
,等等。
You can use the dependsOn
key to set the execution order of the stages, and use condition
key to set a stage only runs when the specified condition is met.您可以使用
dependsOn
键设置阶段的执行顺序,使用condition
键设置阶段仅在满足指定条件时运行。
To view more details, you can see " Add stages, dependencies, & conditions ".要查看更多详细信息,您可以查看“ 添加阶段、依赖项和条件”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.