From 62585059037e4e90bb0441632599aec5a5fcf2b9 Mon Sep 17 00:00:00 2001 From: Holger Wasem Date: Mon, 4 Sep 2023 10:17:46 +0200 Subject: [PATCH] commit by to_remotes 2023-09-04 10:17:46 +0200 from vmdevhw --- init.sh | 58 +++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/init.sh b/init.sh index 6afda78..e77ac77 100755 --- a/init.sh +++ b/init.sh @@ -23,11 +23,8 @@ 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 "please now upload pub key into repo ..." +echo "firefox https://git.service.wiseadvice.eu/" echo " " cat $HOME/.ssh/deploy_key.pub @@ -35,13 +32,13 @@ 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 - +WA_REPO=$HOME/wa_repos +if [ -d "$WA_REPO" ]; then + echo "$WA_REPO does exist, skipping cloning" +else + 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 @@ -49,29 +46,20 @@ Host git.service.wiseadvice.eu IdentitiesOnly yes EOT - git_target=$HOME/wa_repos_test - rm -rf $git_target - mkdir -p $git_target - - cd $git_target + rm -rf $WA_REPO + mkdir -p $WA_REPO + cd $WA_REPO + echo "starting to pull into $(pwd)" + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/shared_resources_k8s.git + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/cimp_etops_lgt.git + git clone git@git.service.wiseadvice.eu:wiseadvice_apps/common_sysadmin.git - 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 - ln -sf $HOME/common_sysadmin/k8s $HOME/kubeconfs - - git clone git@git.service.wiseadvice.eu:wiseadvice_apps/common_sysadmin.git - - - - -else - echo "Aborting" + ln -sf $WA_REPO/common_sysadmin/k8s $HOME/kubeconfs_common + ln -sf $WA_REPO/shared_resources_k8s/k8s $HOME/kubeconfs_common + ln -sf $WA_REPO/shared_resources_k8s/manifest.sh .zshrc + ln -sf $WA_REPO/cimp_etops_lgt/k8s $HOME/kubeconfs + else + echo "Aborting" + fi fi