How to download an artifact published in one pipeline to another pipeline in the same project?
See original GitHub issueRequired Information
Type: Question (or Bug?)
Task Name: DownloadPipelineArtifactV2
Environment
Azure Pipelines
- Agent - Hosted, windows-2019
Issue Description
I have 2 pipelines, both defined as YAML, in the same project. The first pipeline builds and tests the code and publishes some Python source distribution and wheel archives. The second pipeline’s job is to build some HTML docs. To do that it first needs to download the wheel archive published by the latest build in the master branch of the first pipeline.
The first pipeline has this publish task in its YAML:
- publish: $(Build.SourcesDirectory)/dist
displayName: Publish distribution archives to Pipeline Workspace
artifact: 'Distribution archives'
The publishing works fine and I see a whl file appear under Artifacts/Distribution archives in the UI for a build.
The second pipeline has this step to download the whl file:
- task: DownloadPipelineArtifact@2
displayName: Download built distribution
inputs:
source: 'specific'
project: '$(System.TeamProjectId)'
pipeline: 288
runVersion: 'latestFromBranch'
runBranch: 'master'
artifactName: 'Distribution archives'
itemPattern: '*.whl'
I got the 288 value for pipeline
from the value of definitionId
in the URL for the list of builds under the first pipeline (https://dev.azure.com/<org>/<project>/_build?definitionId=288&_a=summary
)
But the second pipeline fails with this error:
##[error]No builds currently exist in the build definition supplied.
What am I doing wrong please? The docs at https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops seem to be out of date (e.g., the project
values are wrong in the examples). I’m also not clear whether I should even be using this task as opposed to DownloadBuildArtifacts@0
instead, and I don’t mind switching to that task if necessary.
Task logs
2020-01-15T14:45:25.3085847Z ##[debug]Evaluating condition for step: 'Download built distribution'
2020-01-15T14:45:25.3086413Z ##[debug]Evaluating: SucceededNode()
2020-01-15T14:45:25.3086488Z ##[debug]Evaluating SucceededNode:
2020-01-15T14:45:25.3086640Z ##[debug]=> True
2020-01-15T14:45:25.3086804Z ##[debug]Result: True
2020-01-15T14:45:25.3086973Z ##[section]Starting: Download built distribution
2020-01-15T14:45:25.3194004Z ==============================================================================
2020-01-15T14:45:25.3194061Z Task : Download Pipeline Artifacts
2020-01-15T14:45:25.3194096Z Description : Download build and pipeline artifacts
2020-01-15T14:45:25.3194828Z Version : 2.2.0
2020-01-15T14:45:25.3194887Z Author : Microsoft Corporation
2020-01-15T14:45:25.3194919Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/download-pipeline-artifact
2020-01-15T14:45:25.3194951Z ==============================================================================
2020-01-15T14:45:26.4494546Z ##[error]No builds currently exist in the build definition supplied.
2020-01-15T14:45:26.4501625Z ##[debug]Processed: ##vso[task.logissue type=error;]No builds currently exist in the build definition supplied.
2020-01-15T14:45:26.4502090Z ##[debug]Processed: ##vso[task.complete result=Failed;]
2020-01-15T14:45:26.4627917Z ##[debug] at Agent.Plugins.PipelineArtifact.DownloadPipelineArtifactTaskV2_0_0.GetPipelineIdAsync(AgentTaskPluginExecutionContext context, String pipelineDefinition, String pipelineVersionToDownload, String project, String[] tagFilters, String branchName)
at Agent.Plugins.PipelineArtifact.DownloadPipelineArtifactTaskV2_0_0.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, CancellationToken token)
at Agent.PluginHost.Program.Main(String[] args)
2020-01-15T14:45:26.4719823Z ##[section]Finishing: Download built distribution
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
When I added
allowPartiallySucceededBuilds: true
underinputs:
the error “##[error]No builds currently exist in the build definition supplied” disappeared. I should’ve noted that builds of the first pipeline have only been partially succeeding (although the steps that publish the artifacts work fine).I’ve since also changed the value for
runBranch
torefs/heads/master
but I don’t know if that’s significant here.Hi!
Is there any way to download an artefact published in another organisation, but under the same Azure Active Directory?
Thanks!