gpt4 book ai didi

azure-devops - 我是否必须在 Azure DevOps 管道中明确下载 Artifact ?

转载 作者:行者123 更新时间:2023-12-04 02:35:04 24 4
gpt4 key购买 nike

我正在使用 Azure DevOps 创建一个管道,该管道将有一个阶段来构建和发布函数应用程序作为 Artifact ,然后在后续阶段通过所需的生命周期部署函数应用程序。

我不确定的是我是否需要在后续部署阶段显式下载构建和发布阶段创建的 Artifact ?有很多关于此的文档,但它有点模棱两可,我看不到提到这个特定问题。

  • YAML schema reference
  • Publish and download artifacts

    Artifacts are associated with the run they were produced in and remain available after the run has completed.


  • 这是我的管道的一个例子。 Dev , StagingProduction阶段包含部署策略,并且在许多情况下,这些阶段的部署之间会有延迟(可能是几天)。
    stages:
    - stage: Publish
    displayName: Publish Function App
    jobs:
    - ...
    - stage: Dev
    displayName: Deploy Dev
    jobs:
    - ...
    - stage: Staging
    displayName: Deploy Staging
    jobs:
    - ...
    - stage: Production
    displayName: Deploy Production
    jobs:
    - ...

    要发布包含我的函数应用程序的 Artifact ,我使用了 publish Publish 的最后一个作业中的步骤阶段。
    - publish: $(System.DefaultWorkingDirectory)
    artifact: FunctionApp

    我的问题是,我需要使用相应的 download吗?步入 Dev , StagingProduction部署阶段,或者 Artifact 是否始终可用 $(Pipeline.Workspace) ?请记住,我不会立即完成部署阶段。
    - download: current
    artifact: FunctionApp

    最佳答案

    是的,您需要在每个阶段添加下载 Artifact 步骤,除非您指定作业为 deployment工作:

    - stage: Dev
    displayName: Deploy Dev
    jobs:
    - deployment: Staging
    environment: 'Dev'
    strategy:
    runOnce:
    deploy:
    steps:
    - powershell: Write-Host "Test"

    有关部署作业的更多信息,您可以找到 here .

    关于azure-devops - 我是否必须在 Azure DevOps 管道中明确下载 Artifact ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62359437/

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