Created
February 3, 2023 16:47
-
-
Save winggundamth/05270547640b817ccfef1ae5eb9dd14a to your computer and use it in GitHub Desktop.
Cloud Shell Preparation Script for KAD23 Training
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Generate SSH | |
[[ ! -f ~/.ssh/id_rsa ]] && ssh-keygen -f ~/.ssh/id_rsa -N "" | |
# Install Docker Compose v2 | |
mkdir -p ~/.docker/cli-plugins/ | |
curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose | |
chmod +x ~/.docker/cli-plugins/docker-compose | |
docker compose version | |
# Install Helm | |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash | |
helm version | |
# Put Bash Completion into .bashrc file | |
if ! grep -q 'kubectl completion bash' ~/.bashrc | |
then | |
tee -a ~/.bashrc > /dev/null <<EOT | |
export USE_GKE_GCLOUD_AUTH_PLUGIN=True | |
if ! grep -q 'kubectl completion bash' ~/.bashrc &> /dev/null | |
then | |
# Bash Completion | |
. <(kubectl completion bash) | |
. <(helm completion bash) | |
fi | |
EOT | |
fi | |
git config --global user.name "$USER" | |
git config --global user.email "[email protected]" | |
git config --global init.defaultBranch "main" | |
git config --global pull.rebase false | |
if [ ! -d "$HOME/ratings" ]; then | |
ssh-keygen -F github.com || ssh-keyscan github.com >>~/.ssh/known_hosts | |
git clone https://github.com/winggundamth/kad23-bookinfo-ratings.git $HOME/ratings | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment