如何为所有环境设置通用阶段管道? [英] How to setup generic stage pipeline for all environments?

查看:48
本文介绍了如何为所有环境设置通用阶段管道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个分支都有多个工件.为开发人员启用了连续部署触发器:开发人员:_CI_Dev进行质量检查:_CI_QA进行过渡:_CI_RC

I have multiple artifacts for each branch. Continuous deployment trigger is enabled For Dev: _CI_Dev For QA: _CI_QA For Staging: _CI_RC

我想设置一个公共阶段(因为各个环境中的任务相同),该阶段应该标识源分支并使用相应的工件.

I want to setup a common stage (since the tasks are same across environments) which should identify the source branch and use corresponding artifacts.

如何为质量检查和分期添加批准和关卡?如何确定触发任务(针对工作)的源分支?我是否应该运行Powershell脚本来设置要在任务中使用的变量中的源分支值?

How to add approval and gates only for QA and staging? How do I identify the source branch which triggered the tasks (for a job)? Should I run a powershell script to setup source branch value in variable to be used in tasks?

推荐答案

如何为质量检查和分期添加批准和关卡?如何确定触发任务(针对工作)的源分支?我是否应该运行Powershell脚本来设置要在任务中使用的变量中的源分支值?

How to add approval and gates only for QA and staging? How do I identify the source branch which triggered the tasks (for a job)? Should I run a powershell script to setup source branch value in variable to be used in tasks?

如果我们要为所有工件启用 Continuous Deployment Trigger ,恐怕我们不能仅添加 QA staging 的批准和门来源.

I am afraid we could not add approval and gates only for QA and staging, if we want enable Continuous deployment trigger for all artifact sources.

由于批准和登机口当前没有单独的过滤器,因此它们依赖选项工件过滤器:

That because approval and gates currently do not have separate filters, they rely on the option Artifact filters:

但是,如果我们为 QA staging 设置了 Artifact过滤器,它将从 Dev中过滤出构建:_CI_Dev .显然,这与我们的预期不符.

However, if we set the Artifact filters for QA and staging, it will filter out builds from Dev: _CI_Dev. Obviously this is not in line with our expectations.

要解决此问题,最简单的方法是克隆当前阶段(虽然不能完全符合您最初期望的阶段使用,但目前是最佳解决方案.),它还将克隆该阶段中的所有任务.将选择触发器 stage 更改为 release ,并为 QA 设置 Artifact过滤器登台:

To resolve this issue, the easiest way is to clone the current stage (Although it can't exactly what you originally expected to use one stage, this is currently the best solution.), it will also clone all tasks in that stage. changing Select trigger from stage to release and set the Artifact filters for QA and staging:

注意:不要忘记为上一个阶段的 Dev:_CI_Dev 添加Artifact过滤器.

Note: Do not forget to add Artifact filters for Dev: _CI_Dev to the previous stage.

这篇关于如何为所有环境设置通用阶段管道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆