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

git is able to run hooks on serveral actions on a reposetory. 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, storedd as post-receive/ hook, will deploy the content of the repository to the give TARGET path:

#! /bin/bash 
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:

  • One of the biggest problems is, the script allow a user to overwrite some files of the PyCo installation itsself.
  • Another problem is the branch management. The script does not handle branch changes in any way.

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

Leave a Reply