Skip to content

A postman collection that automate the creation of a repository, build pipeline and release pipeline

License

Notifications You must be signed in to change notification settings

arthuroz/azurepipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Azure Pipeline as code

This is a practical sample of "pipeline as code" for Azure DevOps

What does this project do

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

Tools

Instructions

  • 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

Tips

  • "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