A collection of common Azure Pipeline tasks to be used across out projects
Templates are meant to be included into a project pipeline. Please refer to this guide for examples.
- Always include templates in your pipeline specifying the reference tag, so a new template version can never break your CI/CD workflow.
- When writing templates, make little-to-no use of default values. Instead, pretend the host pipeline to provide them.
- Terraform Setup
- Terraform Apply
- Terraform Plan
- Terraform Setup
- Terraform AWS Apply
- Terraform AWS Plan
- Terraform Install Azure RM Custom Provider
- Rest Healthcheck
- Node Github Release
- Maven Github Release
- Autogenerated Client SDK Publish
- Node Job Setup template
- Terraform Setup
- Terraform Install Azure RM Custom Provider
- Create a dedicated folder in
/templates
, with the name of the template. - Please remember that templates are not inheritedly bound to any specific project or tech: if the template works only on a specific context, make it explicit (example: prefer
npm-publish
topublish
when writing a template to publish a module on npm). - In the folder create a
yaml
file (naming isn't really important, you can call itindex.yaml
ortemplate.yaml
). - In the same folder add a specific README file with:
- a brief description of the template
- an example snippet to describe usage
- a full parameters table
- Add an entry in the
Available templates
section of the repo main README (this file), with a link to the README of the template you just created.
We have a pipeline configured on this project to run test against the templates we produce. Although Azure Pipelines' DSL is not designed for a test-first approach, it's worth to try. Assets, mocks and scripts used for testings can be placed in .devops/__tests__
folder.
Tests are configured to run on every Pull Request and there's no way ton run tests locally, so far. To use a red-green-refactor approach, the best we can do is to work on a branch and open a draft PR on that.
New versions are created automatically on each merge on master branch. It's done automatically using Github Action .github/workflows/release.yml
To allow execute the azure devops pipeline .devops/test-development-pipelines.yaml
we use this repos:
- https://github.com/pagopa/devopsautomation-azure-devops: this repo contains the pipelines
- https://github.com/pagopa/devopsautomation-infra: this repo help to build the infrastructure (agent nodes) for the pipelines