Skip to content

Instantly share code, notes, and snippets.

@mattfinlayson
Created April 21, 2016 18:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfinlayson/c927d429600e45095f1313d227846cac to your computer and use it in GitHub Desktop.
Save mattfinlayson/c927d429600e45095f1313d227846cac to your computer and use it in GitHub Desktop.
Fast and dirty consul install
#!/usr/bin/env bash
set -e
export CONSUL_VERSION=0.6.3
export CONSUL_TEMPLATE_VERSION=0.12.1
echo "Fetching Consul..."
cd /tmp
curl -L -o consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
echo "Installing Consul..."
unzip consul.zip >/dev/null
sudo chmod +x consul
sudo mv consul /usr/local/bin/consul
sudo mkdir -p /etc/consul.d
sudo mkdir -p /opt/consul
sudo mkdir -p /etc/service
echo "Fetching Consul template..."
curl -L -o consul-template.zip https://releases.hashicorp.com/consul-template/${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.zip
echo "installing Consul template..."
unzip consul-template.zip >/dev/null
sudo mv consul-template /opt/consul-template
# Install web ui
echo "Fetching Consul UI"
curl -L -o consul-ui.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_web_ui.zip
echo "Installing UI"
sudo mkdir -p /opt/consul/ui
sudo mv consul-ui.zip /opt/consul/ui
cd /opt/consul/ui
unzip consul-ui.zip >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment