bitbucket autodeploy
Categories
Component ID
2401939
Component name
bitbucket autodeploy
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
Bitbucket autodeploy provide callback for automated git deployments from Bitbucket. The module does not need bitbucket credentials.
Requirements
- Git installed
- PHP shell_exec enabled
- Shell access
Here’s what your deployment workflow will look like:
- Develop your website locally
- When you’re ready to deploy, commit your changes and push them to Bitbucket
- When Bitbucket receives the commit it will notify a deployment script on your server
- The deployment script will fetch the changes into a cloned repository on your server, and checkout files to your public web directory
Install
- Download, install and enable module as usual
- Setup SSH keys to connect securely to Bitbucket without a password prompt.
- Clone Bitbucket repo with --mirror flag in a directory, which can't be accessed via web
git clone --mirror git@bitbucket.org:<username>/<repo-name>.git - Do an initial checkout
GIT_WORK_TREE=/home/<username>/www git checkout -f <branch-name> - Navigate to /admin/config/bitbucket and enter Branch name (same as above), the local Repo dir and www dir
- If no errors module will provide you with a URL
- On the Bitbucket website navigate to your repository’s Administration > Hooks screen and add a new POST hook,pointed at URL, which you can find on /admin/config/bitbucket.
- Push to Bitbucket will execute the hook and module will do the rest.
Credits
Inspired by http://jonathannicol.com/blog/2013/11/19/automated-git-deployments-from-...
