This is a practical sample of "pipeline as code" for Azure DevOps
This project provides a Postman collection that implements a typical pipeline in Azure DevOps
It consists of below requests:
- Configures variables to be used in either URI or JSON payloads
- Creates a repo
- Initialises master branch
- Makes sure nobody can push to master directly and pull requests must be reviewed before merge
- Makes sure comments are resolved before merge into master branch
- Creates dev branch
- Creates build pipeline, which runs a Maven build then publishes a Docker image to Azure Container Registry
- Creates a typical release pipeline that deploys a Spring Boot based micro service to dev, test and staging environments in Azure ASE
This Postman collection also includes a few delete requests that can clean up test repo and pipelines to help tailor the sample pipeline to your own needs
- Clone the repository
- Get Postman
- Import azurepipeline.json into Postman
- Configure variables as needed in "Pre-request Script" of the first request
- Runs the requests as needed in order
- Experiments with the collection and use provided DELETE requests to clean up test pipelines or repository when needed
- "Pre-request Script" of the first request is used to configure global variables
- "Tests" of a few requests are used to capture values from returned JSON payload for later usage
- Azure DevOps uses basic auth. User name is your Azure account email address and password is your PAT token. If you are to handcraft the auth string, please be kindly reminded that a ":" is needed between username and password before the composed string is encoded
- The easiest way to obtain needed variables is to export existing repositories or pipelines from your project as JSON files and then search for those values in exported files