I am trying to convert classic Azure pipelines to YAML.
however, I couldn't find any documents on how can I have an environment deployment utilize a previous build artifact? i.e. if we build and deploy to dev, after testing how can we build that exact same artifact of the build to another environment (such as integration or staging slot)? I don't want to do a whole build again as then we will have a different code base if changes were made in master in the meantime.
I that something possible with YAML pipeline, if so should I approach to implement this?
Your YAML pipeline can specify what resources it needs. You can specify an existing build or another pipeline.
resources:
pipelines:
- pipeline: SmartHotel-resource # identifier for the resource (used in pipeline resource variables)
source: SmartHotel-CI # name of the pipeline that produces an artifact
see:
As an alternative, you can create a multi-stage pipeline. Where your pipeline specifies both the build as well as the deployment steps:
stages:
- stage: A
jobs:
- job: A1
- job: A2
- stage: B
jobs:
- job: B1
- job: B2
See: