Skip to content

Instantly share code, notes, and snippets.

@tcotav
Created August 30, 2015 20:26
Show Gist options
  • Save tcotav/e6f15458924c9209e68a to your computer and use it in GitHub Desktop.
Save tcotav/e6f15458924c9209e68a to your computer and use it in GitHub Desktop.
Go and etcd install script in BASH
#!/bin/bash
### Install git and basic workstation stuff
apt-get install git -y
apt-get install git-flow -y
git clone https://github.com/tcotav/workstation-init.git
cd workstation-init
ln -s ~/workstation-init/vim ~/.vim && ln -s ~/workstation-init/tmux.conf ~/.tmux.conf && ln -s ~/workstation-init/gitignore ~/.gitignore
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
### install golang and dev env -- assumes you're root and on some discardable VPS somewhere
wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz
tar -xzvf go1.5.linux-amd64.tar.gz
mv go /usr/local
export PATH=$PATH:/usr/local/go/bin
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
export GOROOT=/usr/local/go
echo "export GOROOT=/usr/local/go" >> ~/.bashrc
echo "export GOPATH=~/go" >> ~/.bashrc
export GOPATH=~/go
mkdir -p ~/go/src
mkdir -p ~/go/bin
cd ~/go
# get the etcd and any other packages you need
go get github.com/coreos/go-etcd/etcd
### Set up etcd
curl -L https://github.com/coreos/etcd/releases/download/v2.1.2/etcd-v2.1.2-linux-amd64.tar.gz -o etcd-v2.1.2-linux-amd64.tar.gz
tar xzvf etcd-v2.1.2-linux-amd64.tar.gz
cd etcd-v2.1.2-linux-amd64
./etcd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment