Azure DevOps pipelines for Habitat packages
While the pipelines are stored in a single
yml file, there are really two main parts: Build and Deployment. The build tasks are handled in a single stage while the deployment tasks are broken into three separate stages. This gives us the ability to follow a standard
prod deployment model.
The build stage is very simple. It uses the Habitat extension for almost all its steps. The three deployment stages only differ in one spot. The
DeployToDev stage performs a
hab pkg upload... while the
DeployToProd stages execute a
hab pkg promote ... for their respective channels.
The pipelines are generic as they source the
last_build.env files from the build. This allows us to pull the artifact name and the package identifier from the build.
To consume these pipelines, copy the appropriate
yml file from this repository into the root of your project. See my Wildfly repo for an example. The Habitat extension expects the hab specific components to be in a
habitat/ subdirectory within your project.
For a step-by-step walk-through on setting up Azure DevOps pipelines, check out this blog post.