Update README. Add check-deploy script and placeholder post-receive
authorNeil Muller <drnlmuller@gmail.com>
Sat, 21 Mar 2020 18:51:36 +0000 (20:51 +0200)
committerNeil Muller <drnlmuller@gmail.com>
Sat, 21 Mar 2020 18:51:36 +0000 (20:51 +0200)
README.md
check-deploy [new file with mode: 0755]
post-receive [new file with mode: 0755]
slack [changed mode: 0644->0755]

index feeed2fa83e24e5c10cf1c8e660335da8af5c954..387a507acc62e9e1be80912d3a6bcc42093dbc33 100644 (file)
--- 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 (executable)
index 0000000..41f2974
--- /dev/null
@@ -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 (executable)
index 0000000..e69de29
diff --git a/slack b/slack
old mode 100644 (file)
new mode 100755 (executable)