From be854aa304b68062fa4d96b56cfa394dab84cd14 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Tue, 1 Nov 2022 00:22:49 -0700 Subject: [PATCH] New script to validate compose file validity --- server/scripts/compose_config.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 server/scripts/compose_config.sh diff --git a/server/scripts/compose_config.sh b/server/scripts/compose_config.sh new file mode 100644 index 0000000..c011500 --- /dev/null +++ b/server/scripts/compose_config.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +FAIL="" +PASS="" + +echo "==============================" +echo "========== STARTING ==========" +echo "==============================" +for servicedir in /home/joey/homelab/server/config/* +do + service="$(basename $servicedir)" + echo "===== CHECKING $service" + cd $servicedir + { + docker-compose config > /dev/null 2>&1 && + PASS+="$service\n" + } || { + FAIL+="$service\n" + } +done + +echo "==============================" +echo "========== ALL DONE ==========" +echo "==============================" + +echo "========== PASSED ============" +echo -e "$PASS" + +echo "========== FAILED ============" +echo -e "$FAIL" \ No newline at end of file