From a44e857e80b13feb30d5325513a5dac6ffa34829 Mon Sep 17 00:00:00 2001 From: Raine Date: Thu, 26 Oct 2023 14:44:42 +0200 Subject: [PATCH] refactor+feat: renamed scripts with numbers and added some checks for dev envs --- ...all-tools-executable.sh => 00-all-tools-executable.sh} | 0 tools/repo/check.d/{crontabs.sh => 10-crontabs.sh} | 0 tools/repo/check.d/20-no-commented-certbot-domains.sh | 8 ++++++++ tools/repo/check.d/30-no-localhost-domains.sh | 8 ++++++++ ...cker-compose-config.sh => 90-docker-compose-config.sh} | 0 5 files changed, 16 insertions(+) rename tools/repo/check.d/{all-tools-executable.sh => 00-all-tools-executable.sh} (100%) rename tools/repo/check.d/{crontabs.sh => 10-crontabs.sh} (100%) create mode 100755 tools/repo/check.d/20-no-commented-certbot-domains.sh create mode 100755 tools/repo/check.d/30-no-localhost-domains.sh rename tools/repo/check.d/{docker-compose-config.sh => 90-docker-compose-config.sh} (100%) diff --git a/tools/repo/check.d/all-tools-executable.sh b/tools/repo/check.d/00-all-tools-executable.sh similarity index 100% rename from tools/repo/check.d/all-tools-executable.sh rename to tools/repo/check.d/00-all-tools-executable.sh diff --git a/tools/repo/check.d/crontabs.sh b/tools/repo/check.d/10-crontabs.sh similarity index 100% rename from tools/repo/check.d/crontabs.sh rename to tools/repo/check.d/10-crontabs.sh diff --git a/tools/repo/check.d/20-no-commented-certbot-domains.sh b/tools/repo/check.d/20-no-commented-certbot-domains.sh new file mode 100755 index 0000000..f9b3dc4 --- /dev/null +++ b/tools/repo/check.d/20-no-commented-certbot-domains.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for dcf in servers/*/docker-compose.d/docker-compose.yml; do + if grep -e "#.*CERTBOT_DOMAINS" $dcf; then + echo "$dcf has commented out domains!" + exit 1 + fi +done \ No newline at end of file diff --git a/tools/repo/check.d/30-no-localhost-domains.sh b/tools/repo/check.d/30-no-localhost-domains.sh new file mode 100755 index 0000000..5706e28 --- /dev/null +++ b/tools/repo/check.d/30-no-localhost-domains.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for f in servers/*/docker-compose.d/custom/nginx/conf.d/*.conf; do + if grep -e "server_name.*\.localhost" $f; then + echo "$f has a local server_name!" + exit 1 + fi +done \ No newline at end of file diff --git a/tools/repo/check.d/docker-compose-config.sh b/tools/repo/check.d/90-docker-compose-config.sh similarity index 100% rename from tools/repo/check.d/docker-compose-config.sh rename to tools/repo/check.d/90-docker-compose-config.sh