2018-11-12 20:26:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function install_utilities() {
|
2018-12-11 16:02:52 +00:00
|
|
|
sudo apt install vim neovim stow tmux htop ctags
|
2018-11-12 20:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_docker() {
|
2018-12-11 16:02:52 +00:00
|
|
|
if [ -x "$(command -v docker)" ]; then
|
|
|
|
echo "Docker is already installed; skipping..."
|
|
|
|
return
|
|
|
|
fi
|
2019-03-12 16:04:43 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# install the prereqs
|
|
|
|
sudo apt install apt-transport-https ca-certificates curl software-properties-common
|
|
|
|
|
|
|
|
# add the docker key
|
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
|
|
|
|
|
|
# add the docker repo and update apt
|
|
|
|
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
|
|
|
|
sudo apt update
|
|
|
|
|
|
|
|
# install it
|
|
|
|
sudo apt install docker-ce
|
|
|
|
sudo usermod -aG docker ${USER}
|
2018-11-12 20:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_docker_compose() {
|
2018-12-11 16:02:52 +00:00
|
|
|
if [ -x "$(command -v docker-compose)" ]; then
|
|
|
|
echo "Docker Compose is already installed; skipping..."
|
|
|
|
return
|
|
|
|
fi
|
2019-03-12 16:04:43 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# this makes me uncomfortable
|
|
|
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
|
|
|
sudo chmod +x /usr/local/bin/docker-compose
|
2018-11-12 20:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_asdf() {
|
2018-12-11 16:02:52 +00:00
|
|
|
if [ -x "$(command -v asdf)" ]; then
|
|
|
|
echo "asdf is already installed; skipping..."
|
|
|
|
return
|
|
|
|
fi
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# install prereqs
|
|
|
|
sudo apt install automake libssl-dev autoconf libncurses5-dev
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# install the tool
|
|
|
|
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.0
|
2018-11-12 20:26:34 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_google_cloud_sdk() {
|
2018-12-11 16:02:52 +00:00
|
|
|
if [ -x "$(command -v gsutil)" ]; then
|
|
|
|
echo "google cloud sdk is already installed; skipping..."
|
|
|
|
return
|
|
|
|
fi
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# Create environment variable for correct distribution
|
|
|
|
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# Add the Cloud SDK distribution URI as a package source
|
|
|
|
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# Import the Google Cloud Platform public key
|
|
|
|
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
sudo apt update
|
|
|
|
sudo apt install google-cloud-sdk
|
2018-11-12 20:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_pyenv() {
|
2018-12-11 16:02:52 +00:00
|
|
|
if [ -x "$(command -v pyenv)" ]; then
|
|
|
|
echo "pyenv is already installed; skipping..."
|
|
|
|
return
|
|
|
|
fi
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# install the prereqs
|
|
|
|
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
|
2018-11-12 20:26:34 +00:00
|
|
|
|
2018-12-11 16:02:52 +00:00
|
|
|
# we sure do love installing things from random scripts on github these days -_-
|
|
|
|
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
|
|
|
|
}
|
|
|
|
|
|
|
|
# Note: this must be run *after* pyenv is setup and in use
|
|
|
|
function setup_pynvim() {
|
|
|
|
pip3 install --user --upgrade pynvim
|
|
|
|
pip3 install --user --upgrade jedi
|
2018-11-12 20:26:34 +00:00
|
|
|
}
|
|
|
|
|
2018-12-12 03:44:47 +00:00
|
|
|
function install_ctags() {
|
2019-03-12 16:04:43 +00:00
|
|
|
sudo apt install autoconf
|
2018-12-12 03:44:47 +00:00
|
|
|
mkdir -p ~/.install
|
|
|
|
cd ~/.install
|
|
|
|
git clone https://github.com/universal-ctags/ctags.git
|
|
|
|
cd ctags
|
|
|
|
./autogen.sh
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
}
|
|
|
|
|
2019-08-28 15:31:05 +00:00
|
|
|
function install_wtfutil() {
|
|
|
|
mkdir -p ~/.install
|
|
|
|
mkdir -p ~/.bin
|
|
|
|
cd ~/.install
|
|
|
|
wget -O wtfutil.tar.gz https://github.com/wtfutil/wtf/releases/download/v0.20.0/wtf_0.20.0_linux_amd64.tar.gz
|
|
|
|
tar xvfz wtfutil.tar.gz --one-top-level=wdir --strip-components=1
|
|
|
|
cp ./wdir/wtfutil ~/.bin/
|
|
|
|
}
|
|
|
|
|
2020-01-13 19:07:04 +00:00
|
|
|
function install_git_latest() {
|
|
|
|
sudo add-apt-repository ppa:git-core/ppa
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install git
|
|
|
|
}
|
|
|
|
|
2018-11-12 20:26:34 +00:00
|
|
|
#install_utilities # TODO
|
|
|
|
install_docker
|
|
|
|
install_docker_compose
|
|
|
|
install_asdf
|
|
|
|
install_google_cloud_sdk
|
|
|
|
install_pyenv
|
2018-12-12 03:44:47 +00:00
|
|
|
install_ctags
|
2019-08-28 15:31:05 +00:00
|
|
|
install_wtfutil
|
2020-01-13 19:07:04 +00:00
|
|
|
install_git_latest
|
2018-11-12 20:26:34 +00:00
|
|
|
|