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:
parent
42fc4704c6
commit
d199a3ffc3
1 changed files with 19 additions and 0 deletions
19
bootstrap/modules/callback/github.php
Normal file
19
bootstrap/modules/callback/github.php
Normal 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('/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue