Last active
December 18, 2015 00:29
-
-
Save frippz/5696725 to your computer and use it in GitHub Desktop.
Bitbucket POST service script
This file contains 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
<?php | |
try { | |
// Decode JSON data from Bitbucket | |
$payload = json_decode($_REQUEST['payload']); | |
} | |
catch(Exception $e) { | |
exit(0); | |
} | |
file_put_contents('payload.log', print_r($payload, TRUE), FILE_APPEND); | |
// If branch is master | |
if ($payload->commits[0]->branch === 'master') { | |
exec('touch master-success'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment