Build Stages

Gallery jobs are grouped into parallelizable stages. There are two types of stages, pre-infra (init_stages) and post-infra (infra_stages) stages, which have slightly different roles. Define these stages at the top of the .gallery-deploy.yml file:

init_stages:
    - build
infra_stages:
    - deploy

Pre-Infrastructure Stages

Pre-infrastructure stages can be used to build code that will be used by the infrastructure deployment steps. For example, if you need to deploy a docker image to a managed instance group in a terraform file, you'll need to build the image in the pre-infrastructure stage.

Post-Infrastructure Stages

Some providers don't have great support for deploying built code directly using terraform, and you may have to deploy artifacts on top of the infrastructure after it is created. You can use post-infrastructure stages to do this -- you'll have access to environment variable mappers in these stages to give you information on the created infrastructure.

Last updated