From: Alex Pooley (@zuedev) Date: Mon, 23 Mar 2026 10:56:29 +0000 (+0000) Subject: move html check to before docker checks X-Git-Url: http://git.zue.dev/?a=commitdiff_plain;h=525a5d6d1cb7713b408fcbb666675cacef40bb0b;p=git.zue.dev move html check to before docker checks --- diff --git a/cron/minutely.bash b/cron/minutely.bash index 21a4045..6e69661 100644 --- a/cron/minutely.bash +++ b/cron/minutely.bash @@ -15,6 +15,23 @@ fi # enter the repo cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"; exit 1; } +# array of files to check for changes +HTML_FILES_TO_CHECK=( + "site_header.html" + "site_footer.html" + "home_text.html" +) + +# loop through each file and check for changes +for FILE in "${HTML_FILES_TO_CHECK[@]}"; do + if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/$FILE" <(git show HEAD:"html/$FILE"); then + echo "$FILE has changed. Updating local copy..." + git show HEAD:"html/$FILE" > "$DOCKER_COMPOSE_DIRECTORY/$FILE" + else + echo "$FILE has not changed. No action needed." + fi +done + # can we see the docker-compose.yaml file in the repo? git show HEAD:"$DOCKER_COMPOSE_FILENAME" > /dev/null 2>&1 || { echo "Failed to find $DOCKER_COMPOSE_FILENAME in the repository. PANIC!"; exit 1; } @@ -34,24 +51,4 @@ else echo "$DOCKER_COMPOSE_FILENAME has not changed. No action needed." fi -# return to the repo directory -cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"; exit 1; } - -# array of files to check for changes -HTML_FILES_TO_CHECK=( - "site_header.html" - "site_footer.html" - "home_text.html" -) - -# loop through each file and check for changes -for FILE in "${HTML_FILES_TO_CHECK[@]}"; do - if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/$FILE" <(git show HEAD:"html/$FILE"); then - echo "$FILE has changed. Updating local copy..." - git show HEAD:"html/$FILE" > "$DOCKER_COMPOSE_DIRECTORY/$FILE" - else - echo "$FILE has not changed. No action needed." - fi -done - echo "Minutely cron job completed." \ No newline at end of file