Skip to content

Commit

Permalink
added consul to travis testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cgbaker committed Oct 28, 2020
1 parent e9dcbc0 commit ee976ac
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,7 @@ install:
- bash scripts/gogetcookie.sh
- bash scripts/getnomad.sh
- bash scripts/getvault.sh
- bash scripts/getconsul.sh


before_script:
Expand Down
11 changes: 11 additions & 0 deletions scripts/getconsul.sh
@@ -0,0 +1,11 @@
#!/bin/bash

CONSUL_BINARY=https://releases.hashicorp.com/consul/1.8.5+ent/consul_1.8.5+ent_linux_amd64.zip

curl -L $CONSUL_BINARY > consul.zip
sudo unzip -o consul.zip -d /usr/local/bin
sudo chmod 0755 /usr/local/bin/consul
sudo chown root:root /usr/local/bin/consul

which consul
consul -v
7 changes: 7 additions & 0 deletions scripts/start-nomad.sh
Expand Up @@ -10,6 +10,13 @@ if [ ! -e /tmp/vault-test.pid ]; then
echo $VAULT_PID > /tmp/vault-test.pid
fi

if [ ! -e /tmp/consul-test.pid ]; then
consul agent -dev > /dev/null 2>&1 &

CONSUL_PID=$!
echo $CONSUL_PID > /tmp/consul-test.pid
fi

if [ ! -e /tmp/nomad-test.pid ]; then
nomad agent -dev -acl-enabled -vault-address=$VAULT_ADDR -vault-token $VAULT_TEST_TOKEN -vault-enabled -vault-allow-unauthenticated=false > /dev/null 2>&1 &
NOMAD_PID=$!
Expand Down
2 changes: 2 additions & 0 deletions scripts/stop-nomad.sh
@@ -1,5 +1,7 @@
#!/bin/bash

[ -e /tmp/consul-test.pid ] && echo "Stopping consul" && kill $(cat /tmp/consul-test.pid)
rm -f /tmp/consul-test.pid
[ -e /tmp/vault-test.pid ] && echo "Stopping vault" && kill $(cat /tmp/vault-test.pid)
rm -f /tmp/vault-test.pid
[ -e /tmp/nomad-test.pid ] && echo "Stopping nomad" && kill $(cat /tmp/nomad-test.pid)
Expand Down

0 comments on commit ee976ac

Please sign in to comment.