This scaffold is a collection of scripts to facilitate Azure Verified Terraform Module CI pipeline. It's designed to work with CI such as GitHub Actions, and provides a Dockerfile to run these steps on your local machine.
We've provided a docker image at mcr.microsoft.com/azterraform:latest
. This image is built by
the Dockerfile in this repo. We'll build and push a new image when there's a new tag pushed into this
repo.
We maintain all versions of tools that we used in version.env file, if you'd like to build the docker image on your machine, please use the following command (need Linux and awk):
docker build $(sh build-arg-helper.sh version.env) -t localrunner .
To sync versions between version.env and .tflint.hcl and .tflint_example.hcl, we suggest you execute the following command before you commit changes:
docker run --rm -v $(pwd):/src -w /src localrunner sh scaffold-ci-scripts/sync-tflint-plugin-version.sh
On Windows:
docker run --rm -v ${pwd}:/src -w /src localrunner sh scaffold-ci-scripts/sync-tflint-plugin-version.sh
Create a new GNUMakefile
in your module's folder:
SHELL := /bin/bash
-include $(shell curl -sSL "https://raw.githubusercontent.com/Azure/tfmod-scaffold/main/scripts/install.sh" | bash -s > /dev/null ; echo tfmod-scaffold/GNUmakefile)
init:
@sh "$(CURDIR)/scripts/init.sh"
cleanup:
@sh "$(CURDIR)/scripts/cleanup.sh"
To init Github Action CI yaml files in your module, run:
$ make init