Awesome Open Source
Awesome Open Source



SlimJim was born out of a need for a simple auto update script which would update multiple development/test environments every time someone commits to their respective GitHub or BitBucket repositories.

I know there are many deployment/build scripts out there like whiskey_disk, Vlad and Capistrano which can do this if coupled with a CI server like cijoe, Jenkins, etc.

But I found them to be more complicated to setup just for a basic need i.e to simply update a development/test environment using a post-receive hook without any manual user interaction on behalf of the committer besides git push...

How SlimJim Works


To configure SlimJim on your server just follow these 4 steps:

  1. Setup site and DB

Basic LAMP website setup should suffice. Everything you need is in this repo. I'm using a PHP micro-framework called Slim (thus the name!) which requires PHP 5.3.0 or newer.

Run slimjim.sql on your MySql server.

Copy config.sample.php to config.php in the root folder and modify the following variables as needed:

    /* Paths */
   public static $ROOT_PATH = '/srv/www/';

    /* MySQL */
    public static $DB_NAME	= 'slimjim';
    public static $DB_HOST  = 'localhost';
    public static $DB_USER	= 'root';
    public static $DB_PASS	= '';

For all the projects that you want to auto-update, add the name of the github repo, branch and the physical path on your server to the projects table.

Alternatively, you can also manage projects and other settings by going to the administrative interface located at /admin

  1. Install & setup incron

When the site receives a payload from the post-receive hook it will drop a request in the /requests folder. Incron is needed to listen for that event and trigger the deploy script.

[email protected]:/# apt-get install incron

Add the root user to your allow list

[email protected]:/# vi /etc/incron.allow

Add this, save and quit:


Now watch your requests directory for updates

[email protected]:/# incrontab -e

Add this, save and quit:

/srv/www/ IN_CLOSE_WRITE php /srv/www/ $#

  1. Permissions

Give execute permissions to the deploy script

[email protected]:/# chmod +x deploy.php

Allow writing to the requests folder

[email protected]:/# chmod 777 /srv/www/

Give permissions to pull from github to the root user (make sure to leave the password empty)

[email protected]:/# ssh-keygen -t rsa -C "[email protected]"

Copy the contents from ~/.ssh/ and add to GitHub or add to BitBucket

  1. Add Post-Receive Webhook

Finally, add the appropriate one of these URLs as a webhook into your repository settings:

For GitHub:

For BitBucket:

That's it! Now sit back and watch SlimJim do the tedious work! :)


Now if you like what this does, feel free to improve upon code. Just follow these steps to contribute:

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Issue a pull request to my develop branch
  6. I will test out your cool feature on develop and do a release to master soon thereafter! :)

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Php (287,697
Deployment (57,358
Github (43,910
Continuous Deployment (7,080
Slim (2,594
Bitbucket (2,273
Git Hooks (779
Inotify (651