Added github callback script

Can be used to deploy code remotely when you push to master (master is always deployable!) using deploy keys.
This commit is contained in:
Josh Sherman 2013-01-04 11:46:19 -05:00
parent 42fc4704c6
commit d199a3ffc3

View file

@ -0,0 +1,19 @@
<?php
class callback_github extends Module
{
public $method = 'POST';
public function __default()
{
if (isset($_SERVER['REMOTE_ADDR'], $_POST['payload'])
&& in_array($_SERVER['REMOTE_ADDR'], array('207.97.227.253', '50.57.128.197', '108.171.174.178')))
{
`git pull origin master`;
}
Browser::redirect('/');
}
}
?>