2022-12-03 02:03:42 +00:00
|
|
|
CODE_PATH ?= .
|
|
|
|
|
|
|
|
init:
|
2022-12-03 04:01:17 +00:00
|
|
|
@cd $(CODE_PATH) && terraform init -reconfigure -upgrade -backend-config="access_key=$(B2ACCESS)" -backend-config="secret_key=$(B2SECRET)"
|
2022-12-03 02:03:42 +00:00
|
|
|
|
|
|
|
plan: init validate
|
2022-12-03 03:17:50 +00:00
|
|
|
@cd $(CODE_PATH) && terraform plan -var="hcloud_token=$(HETZNERKEY)"
|
2022-12-03 02:03:42 +00:00
|
|
|
|
|
|
|
apply: init validate
|
2022-12-03 03:17:50 +00:00
|
|
|
@cd $(CODE_PATH) && terraform apply --auto-approve -var="hcloud_token=$(HETZNERKEY)"
|
2022-12-03 02:03:42 +00:00
|
|
|
|
|
|
|
refresh: init validate
|
2022-12-03 03:17:50 +00:00
|
|
|
@cd $(CODE_PATH) && terraform refresh -var="hcloud_token=$(HETZNERKEY)"
|
2022-12-03 02:03:42 +00:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
@cd $(CODE_PATH) && terraform fmt -check -recursive
|
|
|
|
|
|
|
|
validate:
|
|
|
|
@cd $(CODE_PATH) && terraform validate
|
|
|
|
|
|
|
|
output: init
|
2022-12-03 03:17:50 +00:00
|
|
|
@cd $(CODE_PATH) && terraform output
|
|
|
|
|
|
|
|
destroy: init validate
|
|
|
|
@cd $(CODE_PATH) && terraform destroy --auto-approve -var="hcloud_token=$(HETZNERKEY)"
|