CI: terraform makefile command parameter
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
vincent 2024-04-27 14:29:38 +02:00
parent ab3c42cf8b
commit 2f6c814fb1

View File

@ -1,15 +1,16 @@
env := production
command ?= apply -auto-approve
deploy_vault:
ifneq (,$(wildcard ~/vaultUnseal/$(env)/rootkey))
VAULT_TOKEN=$(shell cat ~/vaultUnseal/$(env)/rootkey) terraform -chdir=vault apply -auto-approve
VAULT_TOKEN=$(shell cat ~/vaultUnseal/$(env)/rootkey) terraform -chdir=vault $(command)
else
terraform -chdir=vault apply -auto-approve
terraform -chdir=vault $(command)
endif
deploy_dns:
TF_VAR_powerDnsApiKey=$(shell vault kv get -field=API_KEY secrets/nomad/pdns) TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) terraform -chdir=dns apply
TF_VAR_powerDnsApiKey=$(shell vault kv get -field=API_KEY secrets/nomad/pdns) TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) terraform -chdir=dns $(command)
deploy_cloud:
TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) terraform -chdir=cloud apply
TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) terraform -chdir=cloud $(command)