commit by to_remotes 2024-04-29 11:51:36 +0200 from vmdevac
parent
19bf0b17dc
commit
5430354d55
29
init.sh
29
init.sh
|
|
@ -2,9 +2,6 @@
|
|||
WA_REPO=$HOME/wa_repos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "################################################"
|
||||
echo " basic init of wiseadvice node "
|
||||
echo "################################################"
|
||||
|
|
@ -68,13 +65,16 @@ function start_ssh_agent(){
|
|||
|
||||
|
||||
|
||||
if [ -d "$WA_REPO" ]; then
|
||||
|
||||
|
||||
function init_repos(){
|
||||
if [ -d "$WA_REPO" ]; then
|
||||
echo "$WA_REPO does exist, skipping cloning"
|
||||
source $WA_REPO/export_client_name.sh
|
||||
echo "found client name: $CLIENT_NAME"
|
||||
source $HOME/.zshrc
|
||||
git_pull
|
||||
else
|
||||
else
|
||||
echo -n "client name: "
|
||||
read -r CLIENT_NAME
|
||||
|
||||
|
|
@ -95,9 +95,10 @@ else
|
|||
|
||||
ssh-keygen -t rsa -N "$passphrase" -C "deploy_key_$CLIENT_NAME" -f $HOME/.ssh/deploy_key
|
||||
|
||||
echo "please upload now pub key bay logging into user $CLIENT_NAME keys ..."
|
||||
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 "firefox https://git.service.wiseadvice.eu/user/settings/keys"
|
||||
echo "https://git.service.wiseadvice.eu/user/settings/keys"
|
||||
echo " "
|
||||
|
||||
cat $HOME/.ssh/deploy_key.pub
|
||||
|
|
@ -121,7 +122,7 @@ else
|
|||
else
|
||||
echo "set ssh configuration"
|
||||
cat <<EOT >> $HOME/.ssh/config
|
||||
Host git.service.wiseadvice.eu
|
||||
Host git.service.wiseadvice.eu
|
||||
HostName git.service.wiseadvice.eu
|
||||
IdentityFile ~/.ssh/deploy_key
|
||||
Port 8422
|
||||
|
|
@ -152,13 +153,17 @@ EOT
|
|||
echo "Aborting"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
mainmenu() {
|
||||
echo -ne "
|
||||
MAIN MENU
|
||||
1) Init Master
|
||||
2) Join Worker
|
||||
3) Reset Repos and start over again
|
||||
0) Exit
|
||||
Choose an option: "
|
||||
read -r ans
|
||||
|
|
@ -173,6 +178,11 @@ Choose an option: "
|
|||
echo "initializing K8s Worker Set-Up"
|
||||
source $WA_REPO/shared_resources_k8s/k8s/init_worker.sh
|
||||
;;
|
||||
3)
|
||||
rm -rf $HOME/wa_repos
|
||||
init_repos
|
||||
mainmenu
|
||||
;;
|
||||
0)
|
||||
echo "Bye bye."
|
||||
exit 0
|
||||
|
|
@ -184,4 +194,5 @@ Choose an option: "
|
|||
esac
|
||||
}
|
||||
|
||||
init_repos
|
||||
mainmenu
|
||||
|
|
|
|||
Loading…
Reference in New Issue