mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Enos buries the Terraform output from provisioning. Add a shell script to load the environment from provisioning for debugging Nomad during development of upgrade tests.
29 lines
626 B
Bash
Executable File
29 lines
626 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
help() {
|
|
cat <<'EOF'
|
|
Export a set of environment variables so you can debug Nomad while running it
|
|
under this Enos scenario.
|
|
|
|
Usage: $(debug-environment .enos/[directory with Enos state])
|
|
|
|
EOF
|
|
}
|
|
|
|
DIR=${1:-unknown}
|
|
if [[ $DIR == "unknown" ]]; then
|
|
help
|
|
exit 1
|
|
fi
|
|
|
|
pushd $DIR > /dev/null
|
|
cat <<EOF
|
|
export NOMAD_TOKEN=$(terraform output --raw nomad_token)
|
|
export NOMAD_ADDR=$(terraform output --raw nomad_addr)
|
|
export NOMAD_CACERT=$(terraform output --raw ca_file)
|
|
export NOMAD_CLIENT_CERT=$(terraform output --raw cert_file)
|
|
export NOMAD_CLIENT_KEY=$(terraform output --raw key_file)
|
|
EOF
|