azure 无法下载在以前的生成中生成的项目

epfja78i  于 2023-08-07  发布在  其他
关注(0)|答案(1)|浏览(149)

我正在尝试将一些数据从一个管道运行到另一个管道运行。从本质上讲,我的管道是这样工作的:

  • 首先下载数据,如果存在的话(数据是一个文本文件,里面有一个数字)
  • 运行一个脚本,它将使用该数据(如果存在),并生成一些新的
  • 发布新数据

运行脚本和发布文件也可以工作,正如我在管道报告中看到的那样,有一个发布的工件中包含正确的文件。
然而,下载文件总是失败,它只是说:

##[error]Artifact CheckWebsiteState was not found for build 10470.
Finishing: Download artifact

字符串
下面是我使用的YAML脚本:

name: $(Date:yyyyMMdd)$(Rev:-r)

trigger: none

pool:
  vmImage: 'ubuntu-latest'

stages:
- stage: CheckWebsite

  jobs:
  - job: Run
    
    steps:

    - download: current
      artifact: CheckWebsiteState
      displayName: 'Download artifact'
      continueOnError: true

    - task: AWSShellScript@1
      displayName: CheckWebsite
      inputs:
        filePath: '$(System.DefaultWorkingDirectory)/scripts/check-website.sh'
        arguments: '$(Pipeline.Workspace)'

    - publish: $(Pipeline.Workspace)
      artifact: CheckWebsiteState
      displayName: 'Publish artifact'


你知道是什么问题吗?

nhjlsmyf

nhjlsmyf1#

我相信你想从错误的渠道下载艺术品。您需要提供正确的 * 管道资源标识符 *,而不是指定 current。例如,假设我想从我的管道A模板中下载在管道B中发布的工件。我的模板看起来像下面这样。

trigger: none

# You need to define the pipeline resource correctly before you can download from it. 
# You will need to be careful to ensure the pipeline build you want gets selected
# My definition below will select the most recent, successful pipeline run from pipeline B 
# against the main branch, that has had a `ScriptReady` build tag added. You can use a
# tag to ensure the right pipeline build is being selected
resources:
  pipelines:
  - pipeline: pipelineB
    source: pipelines/pipelineB
    brain: main
    tags:
    - ScriptReady

stages:
- stage: CheckWebsite

  jobs:
  - job: Run
    
    steps:
    - download: pipelineB
      artifact: CheckWebsiteState
      displayName: 'Download artifact'
      continueOnError: true

字符串

相关问题