Wiki farm
From FreeCulture.org Wiki
Here is how to create a wiki farm with git:
Stage 1: Create the farm
Step 1: Clone the MediaWiki git repository
- cd ~/chapter-hosting/wiki-skeleton/
- git clone git://code.creativecommons.org/mediawiki.git
- cd mediawiki
- git checkout origin/tags/REL1_12_0 # or whatever version you want to work from!
- git branch -D master # To clear the local "master" branch out
- git checkout -b master # To set the current master to have history starting from what you checked out
The last step is crucial if you don't want to be basing all your wikis on the Subversion HEAD!
Step 2: Configure MW just the way you like it
2a: set up AdminSettings.php
- cp AdminSettings.sample AdminSettings.php
- Then set these options in the obvious places:
$wgDBadminuser = $wgDBuser; $wgDBadminpassword = $wgDBpassword;
- git add AdminSettings.php
- git commit AdminSettings.php -m 'Configuring maintenance scripts to work'
2b: configure LocalSettings.php
- In my case, I already had a LocalSettings.php file the way I liked it, so I copied it into ~/chapter-hosting/wiki-skeleton/mediawiki/
- You might run the web configuration thing instead.
- git add LocalSettings.php
2c: Add extensions
- To add extensions that don't use source control (like recaptcha), just extract them into extensions/ and
- git add extensions/$new_extension/*
- git commit -m 'Imported some extension'
2d: Add extensions that use git
- One could use git submodules (even for svn-based extensions, if one were an exciting fellow).
Stage 2: Deploying a wiki
- git clone -l /home/freecult/chapter-hosting/wiki-skeleton/mediawiki/ mywiki
- Then upate LocalSettings.php (with new DB configuration, at least!)
- (Note: The use of -l is a disk space minimization trick to use hard links rather than copies inside .git. It is safe, but it is optional.)
- git commit
Stage 3: Updating the farm skeleton with new local changes
- Just cd into the wiki-skeleton/mediawiki/ directory, and make changes
- Then be sure to git commit
Stage 4: Updating the farm wikis
Just 'cd' into each of them, and:
- git pull
Stage 5: Updating the farm skeleton with a new upstream release
- git merge origin/REL1_12
That will bring you in line with the REL1_12 branch of MediaWiki. You may prefer to use a tag - if so, try:
- git merge origin/tags/REL1_12_0
You can always:
- git merge origin/trunk
if you're feeling lucky. The gitweb will show you the branches and tags it knows about, listed in order of how recently they have been updated.
Stage 6: Updating the farm wikis with a new upstream release
- From each farm wiki, just "git pull"
The farm doesn't care where the changes came from, so long as they're present in the skeleton's "master" branch.
Stage -1: Importing MediaWiki from svn to git
If you want to track your own MW repository (rather than the one I maintain at code.creativecommons.org), there will be instructions posted soon. It's a pretty simple git-svn import with some fiddling for handling MW's repository layout and pushing remote branches. Follow these instructions.


