File: Makefile

package info (click to toggle)
golang-github-hashicorp-terraform-json 0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,572 kB
  • sloc: makefile: 31
file content (15 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DOCKER_IMAGE_TAG=0.12.6
DOCKER_IMAGE="hashicorp/terraform:${DOCKER_IMAGE_TAG}"
TERRAFORM=docker run --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_SESSION_TOKEN --rm --workdir "$$(pwd)" --volume "$$(pwd)":"$$(pwd)" $(DOCKER_IMAGE)

FIXTURES ?= $(shell find * -maxdepth 0 -type d)

.PHONY: $(FIXTURES)
$(FIXTURES):
	cd $@/ && $(TERRAFORM) init
	cd $@/ && $(TERRAFORM) plan -out=plan.tfplan
	cd $@/ && $(TERRAFORM) show -json plan.tfplan > plan.json
	cd $@/ && $(TERRAFORM) providers schema -json > schemas.json

.PHONY: generate
generate: $(FIXTURES)