changes to script

pull/9624/head
Sharif Elgamal 2020-11-06 14:55:06 -08:00
parent 72fa0be5f4
commit e298618913
1 changed files with 15 additions and 24 deletions

View File

@ -16,29 +16,20 @@
set -eux -o pipefail set -eux -o pipefail
function install_docker() { if [[ "$OSTYPE" == "darwin"* ]]; then
sudo apt-get -y update echo "detected darwin, exiting"
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - return
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian `lsb_release -cs` stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker jenkins
}
function install_kubectl() {
curl -LO "https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
}
echo "Checking docker"
if ! docker version &>/dev/null; then
echo "No docker installation found, installing docker."
install_docker
fi fi
echo "Checking kubectl" echo "Installing latest docker"
if ! kubectl version &>/dev/null; then sudo apt-get -y update
echo "No kubectl installation found, installing kubectl" sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
install_kubectl curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
fi sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian `lsb_release -cs` stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker jenkins
echo "Installing latest kubectl"
curl -LO "https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/kubectl