Files
nomad/e2e/terraform/Makefile
Tim Gross fbcdb125da end-to-end testing improvements for CSI (#26834)
While working on #26831 and #26832 I made some minor improvements to our
end-to-end test setup for CSI:

* bump the AWS EBS plugin versions to latest release (1.48.0)
* remove the unnnecessary `datacenters` field from the AWS EBS plugin jobs
* add a name tag to the EBS volumes we create
* add a user-specific name tag to the cluster name when using the makefile to
  deploy a cluster
* add volumes and other missing variables from the `provision-infra` module to
  the main E2E module

Ref: https://github.com/hashicorp/nomad/pull/26832
Ref: https://github.com/hashicorp/nomad/pull/26831
2025-09-25 09:27:15 -04:00

56 lines
1.5 KiB
Makefile

PKG_PATH ?= $(shell pwd)/../../pkg/linux_amd64/nomad
NOMAD_LICENSE_PATH ?=
CONSUL_LICENSE_PATH ?=
# deploy for quick local development testing
custom.tfvars:
echo 'name = "$(shell whoami)-testing"' > custom.tfvars
echo 'nomad_local_binary = "$(PKG_PATH)"' >> custom.tfvars
echo 'volumes = false' >> custom.tfvars
echo 'client_count_linux = 3' >> custom.tfvars
echo 'client_count_windows_2022 = 0' >> custom.tfvars
echo 'consul_license = "$(shell cat $(CONSUL_LICENSE_PATH))"' >> custom.tfvars
echo 'nomad_license = "$(shell cat $(NOMAD_LICENSE_PATH))"' >> custom.tfvars
.PHONY: plan apply clean destroy plan_full apply_full clean_full destroy_full tidy
plan: custom.tfvars
terraform plan -var-file=custom.tfvars
apply: custom.tfvars
terraform apply -var-file=custom.tfvars -auto-approve
destroy: custom.tfvars
terraform destroy -var-file=custom.tfvars -auto-approve
clean: destroy tidy
# deploy what's in E2E nightly
plan_full:
terraform plan
apply_full:
@terraform apply -auto-approve \
-var="consul_license=$(shell cat $(CONSUL_LICENSE_PATH))" \
-var="nomad_license=$(shell cat $(NOMAD_LICENSE_PATH))"
clean_full: destroy_full tidy
destroy_full:
terraform destroy -auto-approve
# util
# don't run this by default in plan/apply because it prevents you from
# updating a running cluster
tidy:
rm -rf provision-infra/keys
mkdir -p provision-infra/keys
chmod 0700 provision-infra/keys
rm -rf provision-infra/uploads/*
git checkout uploads/README.md
rm -f terraform.tfstate.*.backup
rm custom.tfvars