Skip to content

Commit

Permalink
Refactored build config
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Nov 28, 2023
1 parent cbc9597 commit 3503be5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ clean:
rm -rf .terraform/

validate:
$(TERRAFORM) init -upgrade && $(TERRAFORM) validate
$(TERRAFORM) init && $(TERRAFORM) validate

test: validate
$(CHECKOV) -d /work
Expand Down

0 comments on commit 3503be5

Please sign in to comment.