Let’s look at how we can specify the artifact version to download based on the resource CI build linked to the CD pipeline and check on how to obtain the resource CI build pipeline information such as build number, build id definition id etc., in the CD YAML pipeline.
You can use another build pipeline as a source in your YAML CD pipeline and trigger a deployment in the CD pipeline based on the build pipeline completion. See related posts.
Whether CD pipeline is triggered manually or by the source build pipeline, you can retrieve useful information such as build number, build id of the source pipeline using the below syntax.
$(resources.pipeline.App_CI.pipelineID)
$(resources.pipeline.App_CI.runName)
$(resources.pipeline.App_CI.runID)
$(resources.pipeline.App_CI.runURI)
$(resources.pipeline.App_CI.sourceBranch)
$(resources.pipeline.App_CI.sourceCommit)
$(resources.pipeline.App_CI.sourceProvider)
$(resources.pipeline.App_CI.requestedFor)
$(resources.pipeline.App_CI.requestedForID)
Provided that you have referred another pipeline as resource for the CD pipeline with below shown syntax.
Example CD YAML pipeline implementation is below.
Once the pipeline is executed you can see the information of the source build pipeline printed in your CD/release YAML pipeline.
These values would be useful to retrieve packages in the CD/release pipeline, which are published by build pipeline as artifacts, in the build itself or as NuGet packages to the artifact feeds, using the CI build’s, build number as the package version. We can see usage of the values obtained from source CI build in the CD/release pipeline in a next post.
Related Posts
· We have discussed how to specify a CI pipeline as a resource and a trigger for the CD YAML pipeline in the post “Trigger Deployment YAML Pipeline Once YAML Build Completed”.
· The way to select a particular build while triggering YAML CD pipeline was described in the post “Selecting Particular Source CI YAM Pipeline Build While Manually Triggering a YAML CD Pipeline”.
· The correct way of setting up CD YAMlL with deployment job is explained in the post "Implementing a CD YAML Pipeline with Deployment Job".
No comments:
Post a Comment