BitBucket Webhooks and Pull automation

I worked on setting up a cool workflow setting the repo from bitbucket to do an automatic pull on the server whenever I pushed from my local environment.

The script I used was this one:

<?php
echo "Begin: Pull code from BitBucket<br/>";
exec('git pull git@bitbucket.org:username/repositoryname.git', $output);
foreach ($output as $o) {
    echo $o . '<br/>';
}
echo "End: Pull code from BitBucket<br/>";

But since BitBucket changed the way their hooks work. It’s now useless. According to some threads on their site, the fix should lay around about the Payload.

$payload = json_decode( 'php://input', TRUE );

However, I’ve no idea what I am looking at, my knowledge of PHP just goes to some basic extent.

Any ideas/pointers on what should I do?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.