PyCo and git

To use PyCo on a remote system with multible users sucks. You have to manage the user rights, provide ssh access and autors have to find the right directories and files.

Using git as a versioning system for a PyCo installation is very nice. But it would be much smarter to handle only the content of the installation in a repository, separated from the files of PyCo itsself.

I have a gitolite installation runinng on the same server running lab.sh.

git is able to run hooks on serveral actions on a repository. These hooks allow to run a script which deploys the latest version of the page content from the repository to the PyCo installation.

The following script, stored as post-receive/ hook, will deploy the content of the repository to the give TARGET path:

#! /bin/bash 
 
TARGET="/var/www/lab.sh"
 
git --work-tree ${TARGET} reset --hard

The script must be placed in the hooks folder of the repository and the TARGET must ba changed to your PyCo installation. Also, the target must be writable by the git daemon.

Now it is possible to edit the content of a PyCo installation using git pushes. This simple solution works quite well for most cases.

But keep in mind - The script has some drawbacks:

Another idea is to combine the PyCo content repository with SparkleShare - I will see if that works…

↑Back to top