diff --git a/bash/.profile b/bash/.profile index 98bbc52..adf534e 100644 --- a/bash/.profile +++ b/bash/.profile @@ -23,13 +23,12 @@ if `tty -s`; then mesg n fi -export PATH=$PATH:~/.bin +export PATH="$HOME/.local/bin:$HOME/.bin:$PATH" export TERM=xterm-256color -# Installed with https://github.com/pyenv/pyenv-installer -if [ -x "$(command -v pyenv)" ] +if [ -d "$HOME/.pyenv" ] then - export PATH="/home/nicholas/.pyenv/bin:$PATH" + export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" fi @@ -39,6 +38,16 @@ then source $HOME/.install/google-cloud-sdk/path.bash.inc fi +if [ -x "$(command -v yarn)" ] && [ -d "$HOME/.yarn/bin" ] +then + export PATH="/home/nicholas/.yarn/bin:$PATH" +fi + +if [ -d "$HOME/.asdf" ] +then + . $HOME/.asdf/asdf.sh +fi + alias iex="iex --erl \"-kernel shell_history enabled\"" if [ -f /usr/local/etc/bash_completion ] diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e607a20 --- /dev/null +++ b/install.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +function install_utilities() { + sudo apt install vim stow tmux htop +} + +function install_docker() { + if [ -x "$(command -v docker)" ]; then + echo "Docker is already installed; skipping..." + return + fi + + # 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} +} + +function install_docker_compose() { + if [ -x "$(command -v docker-compose)" ]; then + echo "Docker Compose is already installed; skipping..." + return + fi + + # 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 +} + +function install_yarn() { + if [ -x "$(command -v yarn)" ]; then + echo "yarn is already installed; skipping..." + return + fi + + # add the key + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + # add the repo and update apt + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + sudo apt update + + sudo apt install yarn +} + +function install_asdf() { + if [ -x "$(command -v asdf)" ]; then + echo "asdf is already installed; skipping..." + return + fi + + # install prereqs + sudo apt install automake libssl-dev autoconf libncurses5-dev + + # install the tool + git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.0 + +} + +function install_google_cloud_sdk() { + if [ -x "$(command -v gsutil)" ]; then + echo "google cloud sdk is already installed; skipping..." + return + fi + + # Create environment variable for correct distribution + export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" + + # 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 + + # Import the Google Cloud Platform public key + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + + sudo apt update + sudo apt install google-cloud-sdk +} + +function install_pyenv() { + if [ -x "$(command -v pyenv)" ]; then + echo "pyenv is already installed; skipping..." + return + fi + + # 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 + + # 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 +} + +#install_utilities # TODO +install_docker +install_docker_compose +install_yarn +install_asdf +install_google_cloud_sdk +install_pyenv +