5
0
Fork 0

commit by to_remotes 2023-09-20 12:26:35 +0200 from vmdevhw

main
Holger Wasem 2023-09-20 12:26:35 +02:00
parent 1ecb2503d4
commit 2bea40e54d
1 changed files with 27 additions and 5 deletions

32
init.sh
View File

@ -7,6 +7,29 @@ echo " basic init of wiseadvice node "
echo "################################################"
function clone_repo_with_retry(){
REPO_NAME=$1
echo "starting to pull into $(pwd)"
git clone git@git.service.wiseadvice.eu:wiseadvice_apps/$REPO_NAME.git -b main
if [ "$?" != "0" ]; then
echo " "
echo -n "Have you checked? Should we try again? type yes: "
read -r yes_no
if [ "$yes_no" = "yes" ]; then
echo "starting to pull into $(pwd)"
git clone git@git.service.wiseadvice.eu:wiseadvice_apps/$REPO_NAME.git -b main
else
echo "Aborting"
exit 1
fi
fi
if [ "$?" != "0" ]; then
echo "Aborting"
exit 1
fi
}
if [ -d "$WA_REPO" ]; then
echo "$WA_REPO does exist, skipping cloning"
source $WA_REPO/export_client_name.sh
@ -52,17 +75,16 @@ Host git.service.wiseadvice.eu
IdentitiesOnly yes
EOT
rm -rf $WA_REPO
mkdir -p $WA_REPO
echo "export CLIENT_NAME=$CLIENT_NAME" > $WA_REPO/export_client_name.sh
source $WA_REPO/export_client_name.sh
cd $WA_REPO
echo "starting to pull into $(pwd)"
git clone git@git.service.wiseadvice.eu:wiseadvice_apps/shared_resources_k8s.git -b main
git clone git@git.service.wiseadvice.eu:wiseadvice_apps/cimp_$CLIENT_NAME.git -b main
git clone git@git.service.wiseadvice.eu:wiseadvice_apps/common_sysadmin.git -b main
clone_repo_with_retry cimp_$CLIENT_NAME
clone_repo_with_retry shared_resources_k8s
clone_repo_with_retry common_sysadmin
ln -sf $WA_REPO/common_sysadmin/k8s $HOME/kubeconfs_common
ln -sf $WA_REPO/shared_resources_k8s/k8s $HOME/kubeconfs_common