Azure devops Azure DevOps YAML CI和CD管道
我在Azure DevOps服务中有单独的用于CI和CD的yaml管道。 CI管道将工件发布到文件共享位置\文件共享\项目 在CD管道中,我使用CI管道作为资源,以便可以部署从CI管道生成的工件Azure devops Azure DevOps YAML CI和CD管道,azure-devops,yaml,Azure Devops,Yaml,我在Azure DevOps服务中有单独的用于CI和CD的yaml管道。 CI管道将工件发布到文件共享位置\文件共享\项目 在CD管道中,我使用CI管道作为资源,以便可以部署从CI管道生成的工件 resources: pipelines: - pipeline: POC_pipeline # identifier for the pipeline resource source: CI-pipeline_YAML # source pipeline definition na
resources:
pipelines:
- pipeline: POC_pipeline # identifier for the pipeline resource
source: CI-pipeline_YAML # source pipeline definition name
我的问题是如何下载这个工件,以及从CI管道获取已发布工件路径的预定义变量名是什么
resources:
pipelines:
- pipeline: POC_pipeline # identifier for the pipeline resource
source: CI-pipeline_YAML # source pipeline definition name
我尝试使用,但它没有下载任何东西,这只在我将工件推送到Azure DevOps时起作用
steps:
- download: POC_pipeline
似乎
download
task无法下载发布到文件共享的工件。我可以复制同样的问题。您可以(单击向Microsoft开发团队报告问题,然后选择Azure devops)
作为解决方法,您可以使用下载文件共享工件
- task: DownloadFileshareArtifacts@1
inputs:
filesharePath: '\fileshare\project'
artifactName: artifactName
downloadPath: $(Build.ArtifactStagingDirectory)
工件将下载到downloadPath
中指定的文件夹。在上面的示例中,您将在$(Build.artifactstagindirectory)/artifactName
中找到工件(即C:\agent\\u work\2\a\artifactName
)
检查以查找更多预定义变量
您还可以使用下载文件共享工件。您需要将源
指定为特定
,以及其他项目
、管道
、运行版本
属性。见下文:
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: yourProjectName
pipeline: CI-pipeline_YAML
runVersion: latest
path: $(Build.ArtifactStagingDirectory)
工件将下载到路径中指定的文件夹中
注意:您需要在能够访问文件共享的自托管代理上运行管道。(它将失败,并在云代理上出现错误“无法读取目录\fileshare\project”)