Diff changes between manifests

This commit is contained in:
Pim Kunis 2024-10-13 01:02:15 +02:00
parent 53b2723194
commit 948594f5d3
3 changed files with 35 additions and 12 deletions

View file

@ -2,6 +2,27 @@
set -euo pipefail
first_server="${SERVERS%% *}"
previous_manifest=$(ssh -T "root@$first_server" << EOF
if [[ -f "$GCROOTDIR/${NAME}.yml" ]]; then
cat "$GCROOTDIR/${NAME}.yml"
fi
EOF
)
set +e
if [ -z "$previous_manifest" ]; then
echo No previous manifest found!
else
$DYFF between --set-exit-code <(echo $previous_manifest) $MANIFEST
if [ $? -eq 0 ]; then
exit 0
fi
fi
set -e
read -r -p "Continue? " response
echo Uploading closure...
for server in $SERVERS; do
echo Uploading closure to $server...