Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active November 14, 2019 18:18
Show Gist options
  • Save dwallraff/c195e082b268ad56453fdab332a568db to your computer and use it in GitHub Desktop.
Save dwallraff/c195e082b268ad56453fdab332a568db to your computer and use it in GitHub Desktop.
PCF Jumpbox install script (mostly blatantly stolen from @RamXX. It's cool, we're friends.)
#!/bin/bash
# Blatantly stolen from @RamXX. It's cool, we're friends.
# Script will install a plethora of tools for working with
# PCF deployments and a variety of IaaS's
# For Ubuntu
######
## Basic Tools
######
# Basic OS
sudo apt-get update
# Basic Tools and languages
OS_TOOLS=(\
apt-transport-https \
build-essential \
bzip2 \
ca-certificates \
coreutils \
curl \
dnsutils \
file \
git \
gnupg2 \
hping3 \
httpie \
iperf \
iputils-ping \
iputils-tracepath \
jq \
less \
libdap-bin \
libroot-bindings-ruby-dev \
man \
mongodb-clients \
mosh \
mtr \
mysql-client \
netcat \
nmap \
nodejs \
npm \
postgresql-client-9.5 \
python \
python-dev \
python-pip \
python-setuptools \
rclone \
redis-tools \
ruby \
ruby-dev \
s3cmd \
s3curl \
screen \
shellcheck \
software-properties-common \
tcpdump \
tmate \
tmux \
traceroute \
unzip \
vim \
wamerican \
wget \
whois \
)
sudo apt-get install -y "${OS_TOOLS[@]}"
######
## Add other repos and tools
######
# cloudfoundry cli
curl https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
# docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update -y && sudo apt-get install -y cf-cli docker-ce
######
## IaaS Tools
######
# GCP cli
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
# kubectl
sudo apt-get update && sudo apt-get install -y google-cloud-sdk kubectl
# # AWS cli
python -m pip install --upgrade pip
python -m pip install --upgrade awscli --user
# AZURE cli
export AZ_REPO=$(lsb_release -c -s)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-get update && sudo apt-get install -y azure-cli
# Terraform
cd /usr/local/bin && sudo wget -O terraform \
"$(curl -s https://www.terraform.io/downloads.html | grep -o \".*linux_amd64.*zip.*\" | jq -r '.')" &&
sudo unzip -o terraform && sudo chmod +x terraform
######
## BOSH Tools
######
# bosh
cd /usr/local/bin && sudo wget -O bosh \
"$(curl -s https://bosh.io/docs/cli-v2/#install | grep -o \".*linux-amd64\" | jq -r '.')" &&
sudo chmod +x bosh
# certstrap
cd /usr/local/bin && sudo wget -O certstrap \
"$(curl -s https://api.github.com/repos/square/certstrap/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux | grep -v zip)" && sudo chmod +x certstrap
# om
echo "deb http://apt.starkandwayne.com stable main" | sudo tee /etc/apt/sources.list.d/starkandwayne.list
curl https://raw.githubusercontent.com/starkandwayne/homebrew-cf/master/public.key | sudo apt-key add -
sudo apt-get update && sudo apt-get install -y om
# ombosh
cd /usr/local/bin && sudo wget -O ombosh https://raw.githubusercontent.com/zmb3/ombosh/master/ombosh.sh
chmod +x /usr/local/bin/ombosh
######
## CloudFoundry Tools
######
# pivnet
cd /usr/local/bin && sudo wget -O pivnet \
"$(curl -s https://api.github.com/repos/pivotal-cf/pivnet-cli/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep --color=never linux)" && sudo chmod +x pivnet
# cf cli
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
curl https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
sudo apt-get update && sudo apt-get install -y cf-cli
# https://plugins.cloudfoundry.org/?
# uaac cli
sudo gem install cf-uaac --no-rdoc --no-ri
# bbr
cd /usr/local/bin && sudo wget -O bbr \
"$(curl -s https://api.github.com/repos/cloudfoundry-incubator/bosh-backup-and-restore/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url')" && sudo tar xf bbr releases/bbr --strip-components 1 \
&& sudo chmod +x bbr
# asg creator
cd /usr/local/bin && sudo wget -O asg-creator \
"$(curl -s https://api.github.com/repos/cloudfoundry-incubator/asg-creator/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux)" && sudo chmod +x asg-creator
# cf-mgmt
cd /usr/local/bin && sudo wget -O cf-mgmt \
"$(curl -s https://api.github.com/repos/pivotalservices/cf-mgmt/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux | grep -v config)" && sudo chmod +x cf-mgmt
cd /usr/local/bin && sudo wget -O cf-mgmt-config \
"$(curl -s https://api.github.com/repos/pivotalservices/cf-mgmt/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux | grep config)" && sudo chmod +x cf-mgmt-config
# pivnet cli
cd /usr/local/bin && sudo wget -O pivnet \
"$(curl -s https://api.github.com/repos/pivotal-cf/pivnet-cli/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux)" && sudo chmod +x pivnet
######
## Other Tools
######
# vault
cd /usr/local/bin && sudo wget -O vault \
"$(curl -s https://www.vaultproject.io/downloads.html | grep -o \".*linux_amd64.*zip.*\" | jq -r '.')" &&
sudo unzip -o vault && sudo chmod +x vault
# credhub
cd /usr/local/bin && sudo wget -O credhub \
"$(curl -s https://api.github.com/repos/cloudfoundry-incubator/credhub-cli/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux)" && sudo tar xzf credhub \
&& sudo chmod +x credhub
# fly cli
cd /usr/local/bin && sudo wget -O fly \
"$(curl -s https://api.github.com/repos/concourse/fly/releases/latest \
| jq --raw-output '.assets[] | .browser_download_url' | grep linux)" && sudo chmod +x fly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment