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