How do I start an automatic deployment from Bitbucket?

Last updated by Adam West on September 01, 2017 17:09

Each server or group has what is known as a "Deploy Hook", this is a URL that you add to BitBucket as a web hook so Deploy is notified when new commits are pushed to your repository and can start automatic deployments.

Getting the "Deploy Hook" URL for a server

  1. Firstly navigate to the "Servers and Groups" page via the Settings on a given Project page: You can also access the page via the Servers box under a given project, inside the main Projects page:
  2. Next head to the edit page for the server:
  3. Find and make a note of the URL under the Automatic Deployment heading on the right hand side:

Adding the "Deploy Hook" to BitBucket

  1. Open your repository up in BitBucket (there's a shortcut at the top of Deploy labelled "Browse Repository") and click the Settings icon, followed by Webhooks in the adjacent menu:

  2. Click Add Webhook: 
  3. Enter a meaningful name for your Webhook, and paste the URL from the Deploy Hook box into the URL box and hit Save

  4. That's it! With this set up Deploy and BitBucket will now work together to automatically push changes to your server.

Specifying a branch to deploy from

The automatic deployment process will check the branch configured for your server (Branch to Deploy from) each time a request is made to the webhook URL. If the branch is found to match, the deployment will be queued, otherwise it will be ignored. If you wish to change the branch, just navigate to your server settings in Deploy, then update the Branch to Deploy from found under Deployment Options.