ikiwiki/doc/post-commit.mdwn

31 lines
1.6 KiB
Plaintext
Raw Normal View History

2006-03-11 06:34:08 +01:00
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.
2006-03-10 10:16:07 +01:00
The best way to run ikiwiki in a [[Subversion]] post-commit hook is using
a [[wrapper]], which can be generated using `ikiwiki --wrapper`.
2006-03-10 09:19:53 +01:00
2006-03-10 10:16:07 +01:00
First, set up the subversion checkout that ikiwiki will update and compile
into your wiki at each subversion commit. Run ikiwiki a few times by hand
2006-03-11 01:40:34 +01:00
to get a feel for it. Now, generate the wrapper by adding "--wrapper"
2006-03-10 10:16:07 +01:00
to whatever command line you've been using to run ikiwiki. For example:
2006-03-10 09:19:53 +01:00
2006-03-10 10:16:07 +01:00
~/wiki-checkout> ikiwiki . ~/public_html/wiki
2006-03-11 01:40:34 +01:00
~/wiki-checkout> ikiwiki . ~/public_html/wiki --wrapper
2006-03-10 10:16:07 +01:00
successfully generated ikiwiki-wrap
The generated wrapper is a C program that is designed to safely be made
suid if necessary. It's hardcoded to run ikiwiki with the settings
2006-03-11 01:40:34 +01:00
specified when you ran --wrapper, and can only be used to update and
2006-03-10 10:16:07 +01:00
compile that one checkout into the specified html directory.
Now, put the wrapper somewhere convenient, and create a post-commit hook
script in your subversion repository for the wiki. All the post-commit
2006-03-11 01:40:34 +01:00
hook has to do is run the wrapper (with no parameters).
2006-03-10 10:16:07 +01:00
Depending on your Subversion setup, the post-commit hook might end up
getting called by users who have write access to subversion, but not to
your wiki checkout and html directory. If so, you can safely make
ikiwiki-wrap suid to a user who can write there (*not* to root!). You might
want to read [[Security]] first.
2006-03-13 20:29:21 +01:00
[[setup]] explains setting this up in more detail.