Skip to content

Instantly share code, notes, and snippets.

@shinofara
Created April 9, 2013 12:39
Show Gist options
  • Save shinofara/5345382 to your computer and use it in GitHub Desktop.
Save shinofara/5345382 to your computer and use it in GitHub Desktop.
Githubへのpushを検知して、とある環境でpullするまでの一連の流れ ref: http://qiita.com/items/3b44c3787c67643dca6e
https://github.com/shinofara/<<Repository名>>/settings/hooks
$data = json_decode($_POST['payload'],true);
$branch = $data['ref'];
if ($branch == 'refs/heads/master') {
//ここに処理を記述
}
$branch = $data['ref'];
if ($branch == 'refs/heads/master') {
exec('cd ディレクトリパス;git pull origin master > /dev/null 2>&1 &');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment