I'm doing this currently and used
https://bitbucket.org/itjgray/bitbucket-php-deploy/src as the basis
for what I did. Our Puppet server is already running a web server for
The Foreman and a couple of custom tools, so we opted to use a web
based post-commit hook to do this. Some slight adjustments were made
to git-deploy.sh to cycle through each of the Puppet environments to
update them all when the post-commit hook requests the PHP file on the
Puppet server's web server.
If you can't run the web server on the Puppet server, but you can run
it on a web server that can access your Puppet server, you could
adjust the git-deploy.sh to SSH into the Puppet server and fire off
the appropriate git commands.
Bitbucket also lists the IPs that they will be coming from at
https://confluence.atlassian.com/display/BITBUCKET/What+are+the+Bitbucket+IP+addresses+I+should+use+to+configure+my+corporate+firewall
if you want/need to lock down who can request the URL for
deploy-sh.php
Cheers,
--
Jason Wever