Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Experimental project
This is a sandbox project, which contains experimental code for developer use only.
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-...
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Module categories: Developer Tools
- Created by stefanpetrov on , updated