Skip to content

Instantly share code, notes, and snippets.

@frippz
Last active December 18, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frippz/5696725 to your computer and use it in GitHub Desktop.
Save frippz/5696725 to your computer and use it in GitHub Desktop.
Bitbucket POST service script
<?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