How to setup generic stage pipeline for all environments?

送分小仙女□ 提交于 2021-01-29 06:43:38

问题


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.

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?


回答1:


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?

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:

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.

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:

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



来源:https://stackoverflow.com/questions/65317365/how-to-setup-generic-stage-pipeline-for-all-environments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!