From 7671b51616a25fa6cff9c26fe65d5f703ff94e21 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Mon, 17 Oct 2022 17:44:06 -0400 Subject: Get wiki role to push updates to the right place in docker Ikiwiki has this three-repo setup with post-update hooks --- roles/wiki/templates/post-update | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 roles/wiki/templates/post-update (limited to 'roles/wiki/templates/post-update') diff --git a/roles/wiki/templates/post-update b/roles/wiki/templates/post-update new file mode 100755 index 0000000..523b8de --- /dev/null +++ b/roles/wiki/templates/post-update @@ -0,0 +1,20 @@ +#!/bin/sh + +# Determine what input the hook needs +# post-update takes args, pre/post-receive take stdin +type=args +stdin='' +[ $0 != hooks/post-update ] && { + type=stdin + stdin=`cat` +} + +for h in $0.*; do + [ -x $h ] || continue + if [ $type = args ] + then + $h $@ || { [ $0 = hooks/pre-receive ] && exit 1; } + else + echo "$stdin" | $h || { [ $0 = hooks/pre-receive ] && exit 1; } + fi +done -- cgit v1.2.3