gpt4 book ai didi

azure - 在 Azure DevOps Pipeline "partially"中并行运行两个阶段

转载 作者:行者123 更新时间:2023-12-03 06:49:32 24 4
gpt4 key购买 nike

我的 Azure DevOps 管道有两个阶段。一种带有 Pulumi Preview(我们称之为预览版),另一种带有 Pulumi Up(Up),以便将我的基础设施作为代码运行。

两者都从同一个容器运行,并且需要一段时间才能拉动它。我想在实现之前手动批准预览。

我可以同时拉取并运行两个阶段的容器,但要等待 UP-Stage 的最后一个作业,直到预览阶段获得批准吗?

目前它们相互依赖如下:

trigger:
- master

pool:
vmImage: 'ubuntu-latest'

stages:
- stage: Pulumi_Preview
jobs:
- job: Preview
container:
image: REGISTRY.azurecr.io/REPOSITORY:latest
endpoint: ServiceConnection
steps:
- task: Pulumi@1
displayName: pulumi preview
inputs:
azureSubscription: 'Something'
command: 'preview'
args: '--diff --show-config --show-reads --show-replacement-steps'
stack: $(pulumiStackShort)
cwd: "./"

- stage: Pulumi_Up
displayName: "Pulumi (Up)"
dependsOn: Pulumi_Preview
jobs:
- job: Up
container:
image: REGISTRY.azurecr.io/REPOSITORY:latest
endpoint: ServiceConnection
steps:
- task: Pulumi@1
inputs:
azureSubscription: 'Something'
command: 'up'
args: "--yes --skip-preview"
stack: $(pulumiStackShort)
cwd: "./"

最佳答案

您可以使用Manual Validation Task .

Use this task in a YAML pipeline to pause a run within a stage, typically to perform some manual actions or validations, and then resume/reject the run.

jobs:
- job: waitForValidation
displayName: Wait for external validation
pool: server
timeoutInMinutes: 4320 # job times out in 3 days
steps:
- task: ManualValidation@0
timeoutInMinutes: 1440 # task times out in 1 day
inputs:
notifyUsers: |
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3f4b5a4c4b7f4b5a4c4b115c5052" rel="noreferrer noopener nofollow">[email protected]</a>
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5b3e233a362b373e1b3e233a362b373e75383436" rel="noreferrer noopener nofollow">[email protected]</a>
instructions: 'Please validate the build configuration and resume'
onTimeout: 'resume'

关于azure - 在 Azure DevOps Pipeline "partially"中并行运行两个阶段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73825471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com