Created
April 9, 2013 12:39
-
-
Save shinofara/5345382 to your computer and use it in GitHub Desktop.
Githubへのpushを検知して、とある環境でpullするまでの一連の流れ ref: http://qiita.com/items/3b44c3787c67643dca6e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/shinofara/<<Repository名>>/settings/hooks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = json_decode($_POST['payload'],true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$branch = $data['ref']; | |
if ($branch == 'refs/heads/master') { | |
//ここに処理を記述 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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