I’m a Bitbucket.org user and please don’t judge me for that. There are a lot of different opinions about Bitbucket vs. GitHub, but mine is the only one that matters to me since I’m extremely satisfied with the features and the use of Bitbucket. Why would I switch to any other source control service? Now that we cleared that out, let’s talk about this post’s subject. :)
Actualy two of them. I have a hosting account in Slovenia, they block all foreign IP’s to connect to FTP, so It’s pain in the but to make some changes on the script there. My other problem (while working on WhoAPI); if you have let’s say 20 hosting accounts all over the world and you need to update the same script that’s on all of them, how would you do it? (no control of the server modules, so no automatic deployment)
I found no scripts that can solve these problems. I’m sure that they exists, but I lost two (if not more) hours trying to find a finished and a working one.
I made a script (one file) that you upload to your server, change two lines of code, set the Bitbucket settings to ping the script as soon as you make the change to your files on your repository (30sec. job) and you’re done! What this script does is it download’s your script from the Bitbucket repository and extracts it, so you have the latest version of your script always live.
No FTP, no drag&dropping files or scp-ing to the server directly. Out of the box solution for easy automatic script deployment. And yes, It’s in PHP :/ I would like to write the same thing in Python, and Node.js version would be cool as well.
Check it out here: https://bitbucket.org/edifreak/autopullrepo