From a781c740bd0cf1458082dd6da6b962c57c1d3bea Mon Sep 17 00:00:00 2001 From: Neil Muller Date: Sat, 21 Mar 2020 20:51:36 +0200 Subject: [PATCH] Update README. Add check-deploy script and placeholder post-receive --- README.md | 10 ++++++++++ check-deploy | 23 +++++++++++++++++++++++ post-receive | 0 slack | 0 4 files changed, 33 insertions(+) create mode 100755 check-deploy create mode 100755 post-receive mode change 100644 => 100755 slack diff --git a/README.md b/README.md index feeed2f..387a507 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ CTPUG gitolite hooks This repository is to track the various git hooks used by the CTPUG git infrastructure. +We don't use the gitolite hooks via admin option, because it requires a less standard +config. + These hooks are not automatically installed / deployed - that requires manual intervention on the actual server. @@ -17,9 +20,16 @@ This handles posting commit messages to IRC via irker. This handles posting commit messages to Slack using the slack webhook interface +### post-receive + +This is the global post-receive hook that dispatches messages to the appropriate +notifiers if the config option is specified. + Scripts ------ ### check-deploy This can be run on the server to report any outdated hooks. + +check-deploy asumes that the hooks repo is checked out on the server to ~/local/gitolite-hooks diff --git a/check-deploy b/check-deploy new file mode 100755 index 0000000..41f2974 --- /dev/null +++ b/check-deploy @@ -0,0 +1,23 @@ +#!/bin/bash + +cd ~/local/gitolite-hooks + +HOOK_DIR=~/.gitolite/hooks + + +git pull + +for x in *; do + if [ "$x" = "check-deploy" ]; then + continue + elif [ "$x" = "README.md" ]; then + continue + fi + if [ ! -f $HOOK_DIR/$x ]; then + echo "$x doesn't exist in hook dir $HOOK_DIR" + continue + fi + if ! cmp $x $HOOK_DIR/$x; then + echo "$x differs from $HOOK_DIR/$x" + fi +done diff --git a/post-receive b/post-receive new file mode 100755 index 0000000..e69de29 diff --git a/slack b/slack old mode 100644 new mode 100755 -- 2.34.1