open-nomad/e2e/terraform/Makefile
Tim Gross 06c75460f3
e2e: provide precedence for version variables (#9216)
The `nomad_sha`, `nomad_version`, and `nomad_local_binary` variables for the
Nomad provisioning module assumed that only one would be set. By having the
override each other with an explicit precedence, it makes it easier to avoid
problems with Terraform's implicit variables behavior.

Set the expected default values in the `terraform.full.tfvars` to avoid
shadowing by any future changes to the `terraform.tfvars` file.

Update the Makefile to put the `-var` and `-var-file` in the correct order.
2020-10-29 09:15:22 -04:00

30 lines
662 B
Makefile

NOMAD_SHA ?= $(shell git rev-parse HEAD)
PKG_PATH = $(shell pwd)/../../pkg/linux_amd64/nomad
dev-cluster:
terraform apply -auto-approve \
-var="nomad_sha=$(NOMAD_SHA)"
terraform output environment
dev-cluster-from-local:
terraform apply -auto-approve \
-var="nomad_local_binary=$(PKG_PATH)"
terraform output environment
clean:
terraform destroy -auto-approve
full-cluster:
terraform apply -auto-approve \
-var-file=terraform.full.tfvars \
-var="nomad_sha=$(NOMAD_SHA)"
plan-dev-cluster:
terraform plan \
-var="nomad_sha=$(NOMAD_SHA)"
plan-full-cluster:
terraform plan \
-var-file=terraform.full.tfvars \
-var="nomad_sha=$(NOMAD_SHA)"