Terraform-IaC/Makefile
oscarpocock 31e1f425e8
All checks were successful
ci/woodpecker/push/destroy Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Added hetzner secret
2022-12-03 03:17:50 +00:00

26 lines
No EOL
665 B
Makefile

CODE_PATH ?= .
HETZNERKEY ?= .
init:
@cd $(CODE_PATH) && terraform init -reconfigure -upgrade
plan: init validate
@cd $(CODE_PATH) && terraform plan -var="hcloud_token=$(HETZNERKEY)"
apply: init validate
@cd $(CODE_PATH) && terraform apply --auto-approve -var="hcloud_token=$(HETZNERKEY)"
refresh: init validate
@cd $(CODE_PATH) && terraform refresh -var="hcloud_token=$(HETZNERKEY)"
fmt:
@cd $(CODE_PATH) && terraform fmt -check -recursive
validate:
@cd $(CODE_PATH) && terraform validate
output: init
@cd $(CODE_PATH) && terraform output
destroy: init validate
@cd $(CODE_PATH) && terraform destroy --auto-approve -var="hcloud_token=$(HETZNERKEY)"