Integrating with Bitbucket

Update: While you can still use the approach outlined below we've introduced a faster and easier way of setting up two way integration with Bitbucket. Go to your application's "Settings" page and click the "Configure Bitbucket to deploy to AppHarbor" link found under "Deploy from external repositories". This will give you a list of Bitbucket repositories that you can choose to deploy from.

To provide Mercurial and Git support, AppHarbor has partnered with Bitbucket for repository hosting. There's currently some setup to get this process working. We're working with Bitbucket to automate setup completely.

This sets up two-way integration where Bitbucket notifies us about any new pushes to your application, and we report back the build status for each push so it's displayed on Bitbucket Huas well.

Setup Bitbucket repository

Go ahead and create a new repository If you don't have one already.

bitbucket-create-repo.png

Copy "Build URL" from AppHarbor application

appharbor-build-url.png

Configure Bitbucket's AppHarbor Service

Adding services is done under Admin -> Additional options/settings -> Services.

The values necessary for setting up the AppHarbor service can be extracted from the Build URL: https://appharbor.com/application/{project}/builds?authorization={token}.

bitbucket-add-appharbor-service.png

Grant the apphb user on Bitbucket read-access to your repository

bitbucket-grant-access-for-apphb-user.png

Push code to Bitbucket repository

bitbucket-push-changes.png

Confirm that AppHarbor retrieves, builds and deploys the code.

appharbor-build-deployed.png

##Done You've configured AppHarbor to automatically retrieve code whenever you push to Bitbucket. You can read more about which branches AppHarbor builds and which ones are deployed in this article