added auto config update

This commit is contained in:
Snogard 2023-07-22 17:22:14 +02:00
parent 0a00c2961d
commit 3fd2ae7eaa

View File

@ -32,13 +32,6 @@ if [ ! -d "${workdir}" ]; then
fi
# ----------------------
# read config files
installList=$(cat ${updateConfig} | grep -i install-)
configureList=$(cat ${updateConfig} | grep -i configure-)
buildList=$(cat ${updateConfig} | grep -i build-)
# -----------------------
echo -e "Updating repository\n"
# config repository
@ -75,6 +68,13 @@ fi
git rev-parse --verify HEAD | sudo tee $previusCommitFile
# ------------
# read config files
installList=$(cat ${updateConfig} | grep -i install-)
configureList=$(cat ${updateConfig} | grep -i configure-)
buildList=$(cat ${updateConfig} | grep -i build-)
# -----------------------
echo -e "Starting installation and configs auto update\n"
echo "Kaido: "
@ -87,6 +87,7 @@ echo "current commit: ${currentCommit_config}"
# auto update builds
# echo -e "Checking if custom images need to be built\n"
@ -97,6 +98,7 @@ echo "current commit: ${currentCommit_config}"
# $buildScript $name
# fi
# done
# ---------------------------
# auto update installations
echo -e "Checking if installations need to be updated\n"
@ -114,14 +116,14 @@ echo -e "Installations updated\n"
# ---------------------------
# auto update configs
# echo -e "Checking if configs need to be updated\n"
# for val in $configureList; do
# name=${val:10}
# if git diff --name-only $previusCommit $currentCommit configuration | grep -qi $name ; then
# echo -e "Updating ${name} configuration\n"
# $configureScript $name
# fi
# done
echo -e "Checking if configs need to be updated\n"
for val in $configureList; do
name=${val:6}
if $(git -C "$root" diff --name-only $previusCommit_config $currentCommit_config "$confdir/containers/$name/config" | grep -qi $name) ; then
echo -e "Updating ${name} configuration\n"
$configureScript $name
fi
done
# ---------------------------
echo -e "Configurations Updated\n"