A post commit hook for Jekyll, created in PHP. This hook supports multiple sites being built using Jekyll and managed through GitHub repositories and is perfect for those using a VPS or server to host Jekyll sites.
This Post Receive Hook requires the following to be installed on the server to work:
To setup and use this Post Receive Hook:
git clone https://github.com/klcodanr/PHP-Jekyll-Post-Recieve-Hook [my-vhost-name]
into the virtual host directoryThe hook will log every request received to the error log configured in Apache. If you are unsure if your hook is working, this file should provide detailed logs for you to analyze.
The config.json file is used to configure the PHP Jekyll Post Receive Hook. The format of the file is as follows:
{
"env": {
"rvm_path": "/usr/local/rvm",
},
"git_path": "git",
"jekyll_path": "/usr/local/bin/jekyll",
"projects_root": "/var/scratch",
"sites": {
"https://github.com/user/repo":{
"id": "repo",
"jekyll_args": "build -d /var/www/html",
"project_dir": "/var/somewhereelse/project",
"additional_commands": [
"pwd",
"ps -ef | grep ruby"
]
}
},
"time_limit": 0
}
These settings mean:
/usr/local/bin/jekyll
Each site can have the following settings:
projects_root
and site id