Skip to content

Instantly share code, notes, and snippets.

@jasonodonnell
Last active November 30, 2020 20:44
Show Gist options
  • Save jasonodonnell/e40a9b63eb8e9cd3556d221fd2e16494 to your computer and use it in GitHub Desktop.
Save jasonodonnell/e40a9b63eb8e9cd3556d221fd2e16494 to your computer and use it in GitHub Desktop.
#!/bin/bash
export VAULT_DEV_ROOT_TOKEN_ID="root"
export VAULT_TOKEN="root"
export VAULT_ADDR="http://0.0.0.0:8200"
export NOMAD_ADDR="http://0.0.0.0:4646"
cat <<'EOF' > nomad.hcl
acl {
enabled = true
}
client {
options = {"driver.blacklist" = "java"}
}
EOF
screen -d -m -S nomadScreen nomad agent -dev -config=nomad.hcl
screen -d -m -S vaultScreen vault server -dev &
sleep 10
export NOMAD_TOKEN=$(curl -s --request POST http://localhost:4646/v1/acl/bootstrap | jq -r '.SecretID')
if [[ -z ${NOMAD_TOKEN?} ]]
then
echo "NOMAD_TOKEN is unset. Exiting.."
exit 1
fi
make testacc TESTARGS='-run TestAccDataSourceNomadAccess*'
make testacc TESTARGS='-run TestAccNomadSecret*'
process=$(ps -ef | grep 'vault server' | grep -v 'grep' | awk '{print $2}')
kill $(echo $process | cut -f1 -d'.')
process=$(ps -ef | grep 'nomad agent' | grep -v 'grep' | awk '{print $2}')
kill $(echo $process | cut -f1 -d'.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment