For a release pipeline I want to get the consumed pipeline artifacts from a build artifact via REST API (or a task).
Background: I have a release pipeline in azure devops that consumes one main artifact, the setup. The setup packs several binaries in a certain version inside. In the release pipeline I want to find the system tests that fit to the binaries that were packed in the setup. These system tests are published as artifact together with the binaries.
I have the following piplines, that are triggered one after another:
- BinaryPipeline -> publish artifacts: "binaries", "system tests"
- SetupPipeline -> consumes artifact "binaries" from BinaryPipeline, publish artifacts: "setup",
- Release pipeline -> consumes artifact "setup" from setup pipline, consumes "system tests" from BinaryPipeline
Problem: The release pipeline should consume the artifact "system tests" from the same build (of BinaryPipeline) that was consumed to build the setup.
I tried to solve the problem with the REST API, but
https://dev.azure.com/<company>/<project>/_apis/build/builds/<buildid>/artifacts
returns only the produced artifacts, not the consumed.
I see the following workarounds, still I don't like them:
- Publish a text file that contains version information -> Best workaround. I don't like that I have to rely on a special file in artifacts.
- Set build properties (although I didn't find out how to set the properties during build) -> Didn't find out how
- Republish the system tests in my setup build -> Bad pactrice to copy artifacts
- Parse the logs -> Bad because I've to rely on title names of tasks
How can I get the consumed pipeline artifacts from a build via REST API in Azure Devops?