Todilo
Todilo

Reputation: 1333

DownloadPipelineArtifact@2 get build artificat from select branch

I have a installer pipeline that you can manually run after regular build pipeline (which produces the application).

However, I need the installer to fetch the same build that I select when I run "installer pipeline".

- task: DownloadPipelineArtifact@2
  inputs:
    source: specific
    project: '$(System.TeamProjectId)'
    pipeline: 23
    path: '$(System.ArtifactsDirectory)'
    artifact: 'drop'
    runVersion: 'latestFromBranch'

and in the debug of the pipeline I get: ##[debug]PipelineId from non-trigerringBuild: (and wrong id here)

I run the installing pipeline manually selecting a branch/commit so it cant be hard-coded.

Upvotes: 0

Views: 1708

Answers (1)

Kim Xu-MSFT
Kim Xu-MSFT

Reputation: 2216

From your error message

##[debug]PipelineId from non-trigerringBuild: (and wrong id here)

It indicates you have specified a invalid pipelineID, you could double-check this.

I have followed your steps to create an installer pipeline A to download the Pipeline Artifact from build pipeline B using DownloadPipelineArtifact@2 task

Latest Artifact from main is 1590 and dev is 1593.

enter image description here

enter image description here

Running the installer pipeline manually by selecting main and dev.

Main:

enter image description here

Dev:

enter image description here

Here is the task sample:

- task: DownloadPipelineArtifact@2
  inputs:
    buildType: 'specific'
    project: '{Proj Name}}'
    definition: {definitionID}
    buildVersionToDownload: 'latestFromBranch'
    branchName: 'refs/heads/{branch name}'

Upvotes: 1

Related Questions