prevent unecesary pre_deploy script executions

This commit is contained in:
Alexander Navarro 2024-11-20 11:29:46 -03:00
parent f33c57f1a4
commit 8ccda61811
5 changed files with 42 additions and 3 deletions

View file

@ -2,6 +2,15 @@
# shellcheck disable=all
# This is a handlerbars template, so ignore issues
checksum_file=".dotter/cache/pre_deploy.checksum"
if [[ -e "$checksum_file" ]] && sha256sum --check "$checksum_file" >/dev/null 2>&1; then
echo "Pre deploy script has not changed, skiping script execution"
echo "To override this, remove the checksum file: $checksum_file"
exit 0
fi
{{!~ Detect the distribution ~}}
{{~ assign "distro" (trim (command_output "awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '\"'")) ~}}