aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
index 9b29ee6..c353b1b 100644
--- a/README.md
+++ b/README.md
@@ -34,3 +34,38 @@ won't cause compilation to fail, so don't do that. :)
As with all Cryptech git repositories, all commits to this repository
must be signed by a known key.
+
+For completeness, here's how this hooks into git: hang something like
+the following script off the upstream repository's `update` hook:
+
+```
+#!/bin/sh -
+
+set -xe
+
+ref="$1"
+oldrev="$2"
+newrev="$3"
+
+branch=refs/heads/production
+repo=/some/where/safe.git
+work=/some/where/else
+dest=/some/where/visible
+
+if test "$ref" = "$branch"
+then
+ export CRYPTECH_WIKI_PRODUCTION_BUILD=true
+ cd $work
+ git --git-dir $repo --work-tree $work checkout --force $newrev
+ git --git-dir $repo --work-tree $work submodule update --init
+ pelican --output website --settings pelicanconf.py --fatal errors content
+ chmod -R a+rX $work
+ rsync -a --delete website/ $dest/
+fi
+```
+
+Setting `--git-dir` is *probably* unnecessary, since the hook will
+inherit the `$GIT_DIR` environment variable, but it's also harmless.
+`$CRYPTECH_WIKI_PRODUCTION_BUILD` allows our `pelicanconf.py` to
+default to developer settings while automatically using production
+settings when built using the git hook.