Connect Bitbucket
BitBucket users need to provide access to Semaphore so it can read their repositories.
Overview
You can connect your Bitbucket account to Semaphore in two ways:
- By signing in with BitBucket when creating a new Semaphore account
- By granting access to BitBucket in an existing Semaphore account
How to sign up using BitBucket
If you are creating a new Semaphore account, you can sign in with BitBucket to create the connection automatically.
Follow these steps to create a Semaphore account using BitBucket:
- Log in to your BitBucket account
- Navigate to the Semaphore login page
- Select Log in with BitBucket
- Grant access to the Semaphore OAuth App in BitBucket
- Finish the Semaphore setup
How to connect existing accounts to BitBucket
If you already have a Semaphore account, you can connect it with your BitBucket account. To do that, follow these steps:
- Log in to your existing Semaphore account
- Go to your Semaphore account page
- Under the Repository, click on the Grant access link next to Bitbucket.
- Grant access to the Semaphore OAuth App
How to disconnect a BitBucket account
Disconnecting a BitBucket account removes Semaphore access to your repositories.
To disconnect Semaphore from BitBucket:
- Log in your BitBucket account
- Go to the Application authorization page
- Click on Revoke next to Semaphore 2.0
Troubleshooting guide
If your repositories aren't showing in Semaphore or changes are not triggering new workflows, check the connection between BitBucket and Semaphore.
- Navigate to your Semaphore account
- Read the status next to BitBucket
- If the status is disconnected, click on Grant
Your Bitbucket profile connection on this page can be in one of these states:
- Not Connected: your account is not connected. Next time you attempt to log in, you will need to grant access to Semaphore again.
- Connected: can connect both private and public repositories via OAuth.
You can check and change the permissions of your OAuth App connection on the BitBucket authorization page.
Verify deploy key health
Semaphore generates a deploy key when a project is created. This means there is a deploy key per repository connected to Semaphore.
When a deploy key is broken or invalid, Semaphore shows the following error message:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
To verify the status of a deploy key:
- Open your project settings
- If there isn't a green check next to Deploy Key, the key is invalid
To deploy a new key, click on Regenerate.
A deploy key can be invalidated if:
- it was manually removed from the repository
- OAuth permissions were revoked
- the repository's original owner no longer has access to it
Verify webhook health
Semaphore uses a webhook to detect changes in your repository. When the webhook is broken, Semaphore can't trigger new workflows.
To verify the status of a webhook:
- Open your project settings
- If there isn't a green check next to Deploy Key, the key is invalid
To fix the broken webhook, click on Regenerate. This should generate a new webhook and repair the connection between Semaphore and GitHub.
Reconnecting moved or renamed projects
There are several actions that can break the connection between BitBucket and Semaphore. For example:
- moving the repository to a different location
- renaming the repository
- renaming the BitBucket user account
When this happens, you must update the URL of the repository in Semaphore. To do this:
- Open your project settings
- Type the new repository URL
- Press Change
After changing the URL, double-check the status of the deploy key and the webhook.