https://github.com/certik/spilka-hooks
https://github.com/certik/spilka-hooks
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/certik/spilka-hooks
- Owner: certik
- Created: 2010-09-04T00:14:34.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2011-02-23T19:41:57.000Z (over 15 years ago)
- Last Synced: 2025-02-01T20:13:24.379Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 91.8 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Github Hooks for Spilka
=======================
These hooks setup the following addresses:
http://hooks.hpfem.org/all-update.py
http://hooks.hpfem.org/hermes-update.py
That you then put into the ``Admin``/``Service Hooks``/``Post-Receive URLs`` of
your repository at github and github then access those URLs wheneve someone
pushes something into that repository at github.
These URLs are served at Spilka, so apache launches the ``all-update.py`` or
``hermes-update.py`` scripts (see this git repo) and they update the local git
repositories (mirrors) at Spilka as well as update the docs or anything else
that is needed.
Setup
-----
Redirect ``hooks.hpfem.org`` to your server. Add this to your apache config::
ServerName hooks.hpfem.org
ServerAdmin ondrej@certik.cz
DocumentRoot /var/www3/hooks
Options ExecCGI +FollowSymLinks
Allow from all
AllowOverride all
Order allow,deny
AddHandler cgi-script cgi py
ErrorLog /var/log/apache2/gitweb_error.log
And create ``/var/www3/hooks/hermes-update.py`` (with the contents of the file from this git repo).
And then put this into your ``sudoers`` file::
www-data ALL=NOPASSWD: /bin/su git -c /bin/sh update-repos.sh
www-data ALL=NOPASSWD: /bin/su git -c /bin/sh update-hermes-repo.sh
and create the ``update-repos.sh`` and ``update-hermes-repo.sh`` scripts (take them from this git repo).
Then just setup the ``origin`` remote in the ``/home/git/repositories/hermes.git`` to point to the github repo you want to pull from::
git remote add origin git://github.com/hpfem/hermes.git
Then add the url ``http://hooks.hpfem.org/hermes-update.py`` to the Post-Receive URLs in the admin site.
You can test it by accessing the url http://hooks.hpfem.org/hermes-update.py, it should print::
Running update script.
Done.
Output:
Running as:
uid=1009(git) gid=1009(git) groups=1009(git),1011(h2dev),1012(femhubdev)
Updating repository...
Done.