]> sipb.mit.edu Git - ikiwiki.git/blob - doc/post-commit.mdwn
web commit from 66.118.98.137:
[ikiwiki.git] / doc / post-commit.mdwn
1 A post-commit hook is run every time you commit a change to your subversion repository. To make the wiki be updated each time a commit is made, it can be run from (or as) a post-commit hook.
2
3 The best way to run ikiwiki in a [[Subversion]] post-commit hook is using
4 a wrapper, which can be generated using `ikiwiki --wrapper`.
5
6 First, set up the subversion checkout that ikiwiki will update and compile
7 into your wiki at each subversion commit. Run ikiwiki a few times by hand
8 to get a feel for it. Now, generate the wrapper by adding "--wrapper"
9 to whatever command line you've been using to run ikiwiki. For example:
10
11         ~/wiki-checkout> ikiwiki . ~/public_html/wiki
12         ~/wiki-checkout> ikiwiki . ~/public_html/wiki --wrapper
13         successfully generated ikiwiki-wrap
14
15 The generated wrapper is a C program that is designed to safely be made
16 suid if necessary. It's hardcoded to run ikiwiki with the settings
17 specified when you ran --wrapper, and can only be used to update and
18 compile that one checkout into the specified html directory.
19
20 Now, put the wrapper somewhere convenient, and create a post-commit hook
21 script in your subversion repository for the wiki. All the post-commit
22 hook has to do is run the wrapper (with no parameters).
23
24 Depending on your Subversion setup, the post-commit hook might end up
25 getting called by users who have write access to subversion, but not to
26 your wiki checkout and html directory. If so, you can safely make
27 ikiwiki-wrap suid to a user who can write there (*not* to root!). You might
28 want to read [[Security]] first.