From 3494c84dfd5a8a85fa28c0e72b9a26e67edcbbd5 Mon Sep 17 00:00:00 2001 From: Ben Fortuna Date: Tue, 28 Nov 2023 21:28:12 +1100 Subject: [PATCH] Refactored build config --- .env | 8 ++++---- Makefile | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.env b/.env index 828d055..fe4f4a2 100644 --- a/.env +++ b/.env @@ -1,13 +1,13 @@ -TERRAFORM_VERSION=1.1.8 -TF_PLUGIN_CACHE_DIR?=~/.terraform.d/plugin-cache/ + TERRAFORM_VERSION=1.6.1 +TF_PLUGIN_CACHE_DIR?=${HOME}/.terraform.d/plugin-cache/ AWS_DEFAULT_REGION?=ap-southeast-2 ifneq (, $(shell which terraform)) TERRAFORM=TF_PLUGIN_CACHE_DIR=$(TF_PLUGIN_CACHE_DIR) terraform else TERRAFORM=docker run --rm -v "${PWD}:/work" -v "$(TF_PLUGIN_CACHE_DIR):/plugin-cache" \ - -e AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) -e http_proxy=$(http_proxy) -e TF_PLUGIN_CACHE_DIR=/plugin-cache \ - --net=host -w /work hashicorp/terraform:$(TERRAFORM_VERSION) + -e AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION) -e http_proxy=$(http_proxy) \ + --net=host figurate/terraform:$(TERRAFORM_VERSION) endif TERRAFORM_DOCS=docker run --rm -v "${PWD}:/work" tmknom/terraform-docs diff --git a/Makefile b/Makefile index 7b596f8..6574cd8 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,7 @@ clean: rm -rf .terraform/ validate: - $(TERRAFORM) init -upgrade && $(TERRAFORM) validate && \ - $(TERRAFORM) -chdir=modules/website init -upgrade && $(TERRAFORM) -chdir=modules/website validate + $(TERRAFORM) init && $(TERRAFORM) validate test: validate $(CHECKOV) -d /work @@ -27,14 +26,10 @@ docs: diagram $(TERRAFORM_DOCS) markdown ./modules/website > ./modules/website/README.md format: - $(TERRAFORM) fmt -list=true ./ && \ - $(TERRAFORM) fmt -list=true ./modules/website && \ - $(TERRAFORM) fmt -list=true ./modules/encrypted && \ - $(TERRAFORM) fmt -list=true ./modules/public && \ - $(TERRAFORM) fmt -list=true ./modules/terraform-state + $(TERRAFORM) fmt -list=true -recursive example: - $(TERRAFORM) -chdir=examples/$(EXAMPLE) init -upgrade && $(TERRAFORM) -chdir=examples/$(EXAMPLE) plan -input=false + $(TERRAFORM) -chdir=examples/$(EXAMPLE) init && $(TERRAFORM) -chdir=examples/$(EXAMPLE) plan -input=false release: test git tag $(VERSION) && git push --tags