diff --git a/docs/Upgrade-2.19.md b/docs/Upgrade-2.19.md index 5aed758..9029dba 100644 --- a/docs/Upgrade-2.19.md +++ b/docs/Upgrade-2.19.md @@ -37,6 +37,9 @@ This change was required to enable node restrictions via the upstream aws-iam-au `./bootstrap.sh crds all clusters/$CLUSTER ../../../kubezero/charts` ### Components +- delete old fluentd deployement because labels are immutable and they changed due to the migration to new upstream helm chart +`kubectl delete deployment logging-fluentd -n logging` + `./bootstrap.sh deploy all clusters/$CLUSTER ../../../kubezero/charts` ## Upgrade - ArgoCD @@ -48,4 +51,4 @@ This change was required to enable node restrictions via the upstream aws-iam-au ## Verification / Tests - check if all pods are RUNNING - check any Ingress services -- ... \ No newline at end of file +- ... diff --git a/scripts/git-pre-receive-hook.sh b/scripts/git-pre-receive-hook.sh new file mode 100644 index 0000000..d80aaeb --- /dev/null +++ b/scripts/git-pre-receive-hook.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Reject pushes that contain commits with messages that do not adhere +# to the defined regex. + +# [1] https://www.conventionalcommits.org/en/v1.0.0/#specification + +set -e + +zero_commit='0000000000000000000000000000000000000000' +msg_regex='/^((fixup! |squash! )?(\w+)(?:\(([^\)\s]+)\))?: (.+))(?:\n|$){0,2}?((?:^.+(\n|$))+(?:\n|$){0,2}?)+((?:^.+(\n|$))+)+/gm' + +while read -r oldrev newrev refname; do + # Branch or tag got deleted, ignore the push + [ "$newrev" = "$zero_commit" ] && continue + + # Calculate range for new branch/updated branch + [ "$oldrev" = "$zero_commit" ] && range="$newrev" || range="$oldrev..$newrev" + + for commit in $(git rev-list "$range" --not --all); do + if ! git log --max-count=1 --format=%B $commit | grep -iqE "$msg_regex"; then + echo "ERROR:" + echo "ERROR: Your push was rejected because the commit" + echo "ERROR: $commit in ${refname#refs/heads/}" + echo "ERROR: is not adhering to convential commit format." + echo "ERROR:" + echo "ERROR: Please fix the commit message and push again." + echo "ERROR: https://www.conventionalcommits.org/en/v1.0.0/#specification" + echo "ERROR" + exit 1 + fi + done +done