All Collections
Getting Started
How do I connect Velocity to my on-premise Bitbucket Cloud?
How do I connect Velocity to my on-premise Bitbucket Cloud?
M
Written by Mike Koeneke
Updated over a week ago

Requirements

Setup

1. Create a Bitbucket OAuth Consumer within your Bitbucket organization

  • Add a Name - this can be anything

  • Enter the text below as the "Callback URL" https://velocity.codeclimate.com/settings/vcs/auth/callback

Select the following permissions:

  • Account: Read

  • Workspace membership: Read

  • Projects: Read

  • Repositories: Read

  • Pull requests: Read

  • Issues: Read

  • Snippets: Read

  • Webhooks: Read and write

  • Pipelines: Read

Click ‘Save’ and note the generated Key and Secret for the VCS setup in Velocity.

2. Create VCS in Velocity

In Velocity, go to Velocity -> Settings -> VCS -> ‘Add version control system’

  • Select ‘Bitbucket’ as the VCS type

  • Enter the Bitbucket host name - ‘bitbucket.org

  • Enter the ‘Key’ from the Bitbucket consumer in the ‘OAuth client ID’ field

  • Click ‘Create version control system’

3. Create an Agent for the VCS

Next we want to setup the Agent which will be communicating with your configured VCS.

<a href="https://downloads.intercomcdn.com/i/o/147776884/84aa72be78947be1af825885/create_agent.png" target="_blank" rel="nofollow noopener noreferrer">https://downloads.intercomcdn.com/i/o/147776884/84aa72be78947be1af825885/create_agent.png</a>

You should now see setup instructions for the agent.

4. Run the Agent

On your provisioned server where the agent will operate:

  • run the provided setup commands.

  • The agent will start and run in the background.

  • Verify that the agent is up and running:

bash 
# verify that the container is running
$ docker ps
# follow the agent logs
$ docker ps | grep velocity-agent | cut -d " " -f1 | head -n 1 | xargs docker logs --follow --tail=20

5. Setup your VCS in the Agent

  • Copy the docker command under GitLab/GitLab Self Managed.

  • Replace the VELOCITY_VCS_ID with the ID listed for your VCS in the Available VCS table at the bottom of the agents settings page. Replace the BB_CLIENT_ID with the consumer Key and BB_CLIENT_SECRET with the consumer Secret from Bitbucket.

  • run the command in the agent and you should see the response "Vcs created."

6. Connect your VCS user to Velocity

Authentication details for your VCS are passed securely to running agents via Velocity's API. This allows the Agent to interact with your internal VCS and report back to Velocity with repository information and metrics.

Now that you have your VCS and agent setup, you can connect to your VCS system via the agent.

  • Navigate to Settings > Identities

  • Click "Establish Connection" for your VCS.

<a href="https://downloads.intercomcdn.com/i/o/152888671/2118419b582d22033e2fe778/connect_vcs_user.png" target="_blank" rel="nofollow noopener noreferrer">https://downloads.intercomcdn.com/i/o/152888671/2118419b582d22033e2fe778/connect_vcs_user.png</a>
Did this answer your question?