]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/laptop_wiki_with_git_extended.mdwn
Merge branch 'master' of git://git.ikiwiki.info
[ikiwiki.git] / doc / tips / laptop_wiki_with_git_extended.mdwn
1 [[!meta title="Laptop Ikiwiki extended"]]
2
3 I have (at least) three different hosts, `laptop`, `gitserver`, and `webserver`.
4
5 1. I started by following [[/tips/laptop_wiki_with_git]] to create 
6 a bare repo on `gitserver`, and clone that to a workingdir on  gitserver.
7
8   On the laptop clone gitserver:repo /working/dir 
9
10   Next create a setup file for the laptop with 
11
12         gitorigin_branch=> "",
13         git_wrapper => "/working/dir/.git/hooks/post-commit",
14     
15   At this point, assuming you followed page above, and not my hasty summary, 
16
17         git commit -a 
18
19   should rebuild the output of your wiki.
20    
21 2. Now create a setup file for the server (I call it server.setup).
22
23         gitorigin_branch=> "origin",
24         git_wrapper => "/repo/wiki.git/hooks/post-update.ikiwiki"
25        
26   Note the non-standard and bizzare name of the hook.   
27
28   edit /repo/wiki.git/hooks/post-update so that it looks something like
29
30         /repo/wiki.git/hooks/post-update.ikiwiki
31         rsync -cavz /home/me/public_html/* webserver:/destdir
32
33   Run 
34
35         ikiwiki --setup server.setup
36
37 Now in principle when you run git push on the laptop, the git server will 
38 first do its "regular" thing and update ~/public_html (in my case) and 
39 then rsync it onto the webserver.  For this to work, you need passwordless 
40 ssh or something like it.
41
42 [[DavidBremner]]
43