From 29bf195b456f37758ccab1b8dfc8c38667bf3fa9 Mon Sep 17 00:00:00 2001 From: Holger Wasem Date: Fri, 3 May 2024 13:20:40 +0200 Subject: [PATCH] commit by to_remotes 2024-05-03 13:20:40 +0200 from vmdevhw --- common_lib.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/common_lib.sh b/common_lib.sh index 7667f45..89dcb76 100644 --- a/common_lib.sh +++ b/common_lib.sh @@ -10,35 +10,35 @@ function init_repos(){ else echo -n "client name: " read -r CLIENT_NAME - echo -n "deploy key suffix. Leave blank if first: " - read -r DEPLOY_KEY_SUFFIX if [ ! -f $HOME/.ssh/deploy_key ]; then - echo "create ssh key" - echo -n "ssh passphrase: " + echo -n "deploy key suffix. Leave blank if first key to be deployed for user: " + read -r DEPLOY_KEY_SUFFIX + echo "create ssh key" + echo -n "ssh passphrase: " - stty_orig=$(stty -g) # save original terminal setting. - stty -echo - read -r passphrase - stty "$stty_orig" # restore terminal setting. + 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" + echo "1. client name: $CLIENT_NAME" - mkdir -p $HOME/.ssh + mkdir -p $HOME/.ssh - ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$CLIENT_NAME$DEPLOY_KEY_SUFFIX" -f $HOME/.ssh/deploy_key + ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$CLIENT_NAME$DEPLOY_KEY_SUFFIX" -f $HOME/.ssh/deploy_key - echo "please upload now pub key by logging into user $CLIENT_NAME keys ..." - echo "if user does not exit. login with admin user and create new user with name: $CLIENT_NAME" - echo "make sure the user $CLIENT_NAME is in team shared_deployments and is allowed to pull repository cimp_$CLIENT_NAME" + echo "please upload now pub key by logging into user $CLIENT_NAME keys ..." + echo "if user does not exit. login with admin user and create new user with name: $CLIENT_NAME" + echo "make sure the user $CLIENT_NAME is in team shared_deployments and is allowed to pull repository cimp_$CLIENT_NAME" - echo "https://git.service.wiseadvice.eu/user/settings/keys" - echo " " + echo "https://git.service.wiseadvice.eu/user/settings/keys" + echo " " - cat $HOME/.ssh/deploy_key.pub + cat $HOME/.ssh/deploy_key.pub fi echo " " @@ -94,7 +94,8 @@ EOT function clone_repo_with_retry(){ REPO_NAME=$1 - echo "starting to pull into $(pwd)" + echo "starting to pull into $(pwd) with command" + echo "git clone git@git.service.wiseadvice.eu:wiseadvice_apps/$REPO_NAME.git -b main" git clone git@git.service.wiseadvice.eu:wiseadvice_apps/$REPO_NAME.git -b main if [ "$?" != "0" ]; then echo " "