0

I'm doing a project where I want a intermediate pipeline to consume an artifact from another pipeline to later forward it to another pipeline, which then starts running. I have not managed to find a solution online to this functionality and I'm starting to think that that functionality is not (as of today) supported in Azure DevOps. Can someone confirm whether this implementation is possible with pipelines? If not, how should one approach this scenario? I'm relatively new to Azure DevOps, so it's possible that I might have missed or misunderstood some information online.

I know that a pipeline can download an artifact which was published by another pipeline. And I know about pipeline triggers. Currently I have managed to consume artifacts in the intermediate pipeline, but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.

I appreciate all the help I can get.

2 Answers2

0

As far as I know, the solution would be adding Azure Artificats to store the output from Pipeline 1, then in Pipeline 2, download the artifact.

https://learn.microsoft.com/en-us/azure/devops/artifacts/overview?view=azure-devops

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • Thank you for taking the time to answer this. And I agree with you, this currently seems like the only solution to this problem. I was hoping there would be a more elegant solution to this. – Jonas Fockstedt Sep 17 '20 at 07:30
0

but now I have to find a way to send those artifacts to a specific pipeline, from the intermediate pipeline.

We could publish build artifact from the intermediate pipeline by the Publish Build Artifacts or Publish Pipeline Artifacts task in the intermediate pipeline, then we use the Download Build Artifacts or Download Pipeline Artifacts task in the specific pipeline to download the artifact which we published from intermediate pipeline.

Yo could check this document Publish and download artifacts in Azure Pipelines for some more details.

Update:

Are you aware if this functionality is planned for Azure DevOps? If we put it this way - is it possible for my intermediate pipeline to, depending on some variables, trigger a specific pipeline (i.e. it can trigger two different pipelines, but which one to trigger depends on some variables)?

The answer is yes. There is extension Trigger Build Task, which can be used to trigger a new Build so that build-chaining is possible.

And we just need add the value of the variables as condition for this task, then we could trigger a specific pipeline depending on some variables.

Where this specific pipeline is in another project. Is it also possible for this pipeline to access the variables which I created in my intermediate pipeline?

I think I might understand what you want to achieve. you want to create some variables in the intermediate pipeline, then use this variables in the specific pipeline.

The answer is yes. But there is no directly way to access the variables which you created in intermediate pipeline. The solution we need to set the default value for the variables in the specific pipeline, then use REST API Definitions - Update to update those variables in the intermediate pipeline.

Please check my previous thread for detailed REST API scripts.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    I appreciate that you took the time to answer this. Are you aware if this functionality is planned for Azure DevOps? If we put it this way - is it possible for my intermediate pipeline to, depending on some variables, trigger a specific pipeline (i.e. it can trigger two different pipelines, but which one to trigger depends on some variables)? Where this specific pipeline is in another project. Is it also possible for this pipeline to access the variables which I created in my intermediate pipeline? – Jonas Fockstedt Sep 17 '20 at 08:05
  • Thank you for your updated answer. It looks like this will be the route I will take since what I originally had in mind doesn't seem to work with regards to the current functionality in Azure DevOps. But this solution will do. – Jonas Fockstedt Sep 17 '20 at 11:20