set -e # exit immediately if a simple command exits with a non-zero status
set -u # report the usage of uninitialized variables

# Detect # of CPUs so make jobs can be parallelized
 # Available variables
# $BOSH_COMPILE_TARGET - where this package & spec'd source files are available
# $BOSH_INSTALL_TARGET - where you copy/install files to be included in package
export HOME=/var/vcap

export CONSUL_VERSION=0.8.4

cd consul
unzip consul_${CONSUL_VERSION}_linux_amd64.zip
chmod +x consul

mkdir -p $BOSH_INSTALL_TARGET/bin
cp -a consul $BOSH_INSTALL_TARGET/bin
