mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Use HCP Consul and HCP Vault for the Consul and Vault clusters used in E2E testing. This has the following benefits: * Without the need to support mTLS bootstrapping for Consul and Vault, we can simplify the mTLS configuration by leaning on Terraform instead of janky bash shell scripting. * Vault bootstrapping is no longer required, so we can eliminate even more janky shell scripting * Our E2E exercises HCP, which is important to us as an organization * With the reduction in configurability, we can simplify the Terraform configuration and drop the complicated `provision.sh`/`provision.ps1` scripts we were using previously. We can template Nomad configuration files and upload them with the `file` provisioner. * Packer builds for Linux and Windows become much simpler. tl;dr way less janky shell scripting!
53 lines
1.1 KiB
Makefile
53 lines
1.1 KiB
Makefile
PKG_PATH = $(shell pwd)/../../pkg/linux_amd64/nomad
|
|
LICENSE_PATH ?=
|
|
|
|
# deploy for quick local development testing
|
|
|
|
plan:
|
|
terraform plan \
|
|
-var="nomad_local_binary=$(PKG_PATH)" \
|
|
-var="volumes=false" \
|
|
-var="client_count_ubuntu_bionic_amd64=2" \
|
|
-var="client_count_windows_2016_amd64=0"
|
|
|
|
apply:
|
|
terraform apply -auto-approve \
|
|
-var="nomad_local_binary=$(PKG_PATH)" \
|
|
-var="volumes=false" \
|
|
-var="client_count_ubuntu_bionic_amd64=2" \
|
|
-var="client_count_windows_2016_amd64=0"
|
|
|
|
clean: destroy tidy
|
|
|
|
destroy:
|
|
terraform destroy -auto-approve \
|
|
-var="nomad_local_binary=$(PKG_PATH)" \
|
|
-var="client_count_ubuntu_bionic_amd64=2" \
|
|
-var="client_count_windows_2016_amd64=0"
|
|
|
|
# deploy what's in E2E nightly
|
|
|
|
plan_full:
|
|
terraform plan
|
|
|
|
apply_full:
|
|
@terraform apply -auto-approve \
|
|
-var="nomad_license=$(shell cat $(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 keys
|
|
mkdir keys
|
|
chmod 0700 keys
|
|
rm -rf uploads/*
|
|
git checkout uploads/README.md
|
|
rm -f terraform.tfstate.*.backup
|