Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit POST Hook to git branch, not repository, on Bitbucket

Complicated title, let me explain.

I want to limit an automatic POST hook when I push to the master branch; so it won't fire when I push to the dev branch. This is so the app will only deploy to the live servers when the changes have been merged with master and the new master passes the unit tests.

Is this possible?

like image 329
blakev Avatar asked Nov 20 '13 18:11

blakev


1 Answers

You can't limit when BitBucket fires its POST hook; but you can use the contents of the POST to make the decision about whether or not to proceed with the deployment. Just parse the JSON that BitBucket sends you and only continue if any of the "commits" elements have a "branch" of "master", for example.

like image 111
Ash Wilson Avatar answered Nov 14 '22 11:11

Ash Wilson