From 804f7336c9314d0ab0d2ecb3906ecaed9aa11960 Mon Sep 17 00:00:00 2001 From: Holger Wasem Date: Fri, 1 Sep 2023 15:40:48 +0200 Subject: [PATCH] first commit --- README.md | 3 +++ init.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 README.md create mode 100755 init.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..22ea25a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +**usage** + +curl ... diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..4b0ad57 --- /dev/null +++ b/init.sh @@ -0,0 +1,77 @@ +#!/bin/bash +echo "################################################" +echo " basic init of wiseadvice node " +echo "################################################" + +echo "create ssh key" + + +echo -n "client name: " +read -r client_name + +echo -n "ssh passphrase: " + +stty_orig=$(stty -g) # save original terminal setting. +stty -echo +read -r passphrase +stty "$stty_orig" # restore terminal setting. + + +echo "1. client name: $client_name" + +mkdir -p $HOME/.ssh + +ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$client_name" -f $HOME/.ssh/deploy_key + + + + + +echo "upload pub key into repo" +echo " " + +cat $HOME/.ssh/deploy_key.pub + +echo " " +echo -n "ready to pull? type yes: " +read -r ready_to_pull + +if [ "$ready_to_pull" = "yes" ]; then + + echo "preparing" + + cat <> $HOME/.ssh/config + +Host git.service.wiseadvice.eu + HostName git.service.wiseadvice.eu + IdentityFile ~/.ssh/deploy_key + Port 8422 + IdentitiesOnly yes + +EOT + git_target=$HOME/wa_repos_test + rm -rf $git_target + mkdir -p $git_target + + cd $git_target + + echo "starting to pull into $(pwd)" + + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/shared_resources_k8s.git + + ln -sf $HOME/shared_resources_k8s/k8s $HOME/kubeconfs_common + + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/cimp_etops_lgt.git + + ln -sf $HOME/cimp_etops_lgt/k8s $HOME/kubeconfs + + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/common_sysadmin.git + + ln -sf $HOME/common_sysadmin/k8s $HOME/kubeconfs + + + +else + echo "Aborting" + +fi