Downloading artifacts

A common use of multi-stage pipelines it to separate the build stage and the deployment stage. To make this possible, the build stage often publishes one or more pipeline artifacts. This was discussed in the previous chapter.

All the artifacts that were published in a previous stage of the current pipeline can be downloaded using a download task:

steps:
- download: current
artifact: artifactName

It is also possible to download artifacts from other pipelines. To do this, the current constant has to be replaced with the name of that pipeline. Pipeline artifacts are downloaded to the $(Pipeline.Workspace) directory.

If you want more fine-grained control over downloading pipeline artifacts, for example, over the version of the artifact to use or the location to download the artifact to, you can also use the Download Pipeline Artifacts tasks, which are documented at https://docs.microsoft.com/bs-cyrl-ba/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops.

Publishing and downloading artifacts within a pipeline ensures that the code that is built in the first stage is also the code that is deployed in the second stage even if the stages run days apart. In essence, each pipeline run builds a local stage of all the artifacts associated with that specific run.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.213.209