Support Consul credential generation

Fixes gh-5
This commit is contained in:
Mark Paluch
2016-06-18 21:34:22 +02:00
parent 7a27b605f7
commit 69a4bd2092
10 changed files with 285 additions and 13 deletions

45
src/test/bash/install_consul.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
###########################################################################
# Download and Install Consul #
# This script is prepared for caching of the download directory #
###########################################################################
CONSUL_VER="0.6.3"
UNAME=$(uname -s | tr '[:upper:]' '[:lower:]')
CONSUL_ZIP="consul_${CONSUL_VER}_${UNAME}_amd64.zip"
IGNORE_CERTS="${IGNORE_CERTS:-no}"
# cleanup
mkdir -p consul
if [[ ! -f "download/${CONSUL_ZIP}" ]] ; then
cd download
# install Vault
if [[ "${IGNORE_CERTS}" == "no" ]] ; then
echo "Downloading Consul with certs verification"
wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}"
else
echo "WARNING... Downloading Consul WITHOUT certs verification"
wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}" --no-check-certificate
fi
if [[ $? != 0 ]] ; then
echo "Cannot download Consul"
exit 1
fi
cd ..
fi
cd consul
if [[ -f consul ]] ; then
rm consul
fi
unzip ../download/${CONSUL_ZIP}
chmod a+x consul
# check
./consul --version

View File

@@ -2,7 +2,7 @@
###########################################################################
# Download and Install Vault #
# This script is prepared for caching of the vault/download directory #
# This script is prepared for caching of the download directory #
###########################################################################
@@ -26,7 +26,7 @@ if [[ ! -f "download/${VAULT_ZIP}" ]] ; then
fi
if [[ $? != 0 ]] ; then
echo "Cannot download vault"
echo "Cannot download Vault"
exit 1
fi
cd ..

View File

@@ -0,0 +1,18 @@
#!/bin/bash
###########################################################################
# Start Consul on localhost:8500 #
###########################################################################
BASEDIR=`dirname $0`/../../..
#!/bin/bash
mkdir -p ${BASEDIR}/consul/config
mkdir -p ${BASEDIR}/consul/data
./consul/consul agent -server \
-bootstrap-expect 1 \
-data-dir ${BASEDIR}/consul/data \
-config-file=${BASEDIR}/spring-cloud-vault-config/src/test/resources/consul.json
exit $?