针对特定环境的Azure DevOps管道
我有两个ADO管道是CI和CD,当CI完成CD自动触发时,它们正在运行。
我的要求是我在CI和CD工作中有3个环境,例如Dev STG和ITG CI完成后,我想根据环境选择部署CD作业。
可以说,当我使用Dev stack触发CI作业时,CI完成了CI完成,CD应触发DEV堆栈。 类似地,对于完成CD -ITG堆栈后选择的CI -ITG应该自动完成。
是否有任何方法可以将这两个管道链接起来,以根据环境选择触发。
注意:默认情况下,DEV堆栈在CI和CD之间正常工作,但是当我在CI作业中选择ITG并在CI-ITG完成后,在CD作业开发DEV不运行ITG中。
I have two ADO pipelines one is CI and CD and they are running when CI is completed CD automatically getting triggered without any issues.
My requirement is I have 3 environments in CI and CD jobs like dev stg and itg
I want to deploy my CD job based on environments selections automatically when CI completed.
lets say when I trigger CI job with Dev stack and once CI completed with Dev stack , CD should get triggered dev stack.
similarly for CI -itg selected once done CD- itg stack should be done automatically.
is there any way to link this two pipelines to get triggered based on environments selections.
Note : by default dev stack is working fine between CI and CD, but when I select itg in CI job and as soon as CI-itg completed , in CD job dev running not itg.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的要求,您需要根据CI管道阶段运行触发CD管道阶段。
恐怕没有盒子外的方法可以达到这一要求。
对于解决方法,我建议您可以自然定义发行管道中的变量,并且可以通过REST API修改CI管道中的释放管道变量:“ noreferrer”>“ deactions-update ”。
请参阅以下步骤:
步骤1:定义Release Pipeline变量。
步骤2:在每个阶段添加一个步骤以在CI管道中运行PowerShell脚本。当管道阶段运行时,它将在重酶管道中修改值。
例如:
step3:在Release Pipeline阶段中,您可以设置条件:
eq(变量['dev'],'yes')
例如:
Based on your requiremnt, you need to trigger the CD Pipeline stage based on the CI Pipeline stage running.
I am afraid that there is no out-of-box method can achieve this requirement.
For a workaround, I suggest that you can manaully define the variable in Release Pipeline and you can modify the release pipeline variable in CI pipeline via Rest API:Definitions - Update .
Refer to the following steps:
Step1: Define Release Pipeline variable.
Step2: Add a step to run PowerShell script in CI pipeline to each stage. When the Pipeline stage run, it will modify the value in Relase Pipeline.
For example:
Step3: In Release Pipeline stage, you can set the condition:
eq(variables['dev'], 'Yes')
For example: