1. Create a Bitbucket OAuth Consumer within your Bitbucket organization
In Bitbucket, go to your target workspace and then the Workspace settings. Under "APPS AND FEATURES" *select "OAuth consumers."
Add a Name - this can be anything
Enter the text below as the "Callback URL"
Select the following permissions:
Workspace membership: Read
Pull requests: Read
Webhooks: Read and write
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.
Navigate to the Agents settings section: https://velocity.codeclimate.com/settings/agents/new
click "Create agent"
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:
# 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.
VELOCITY_VCS_IDwith the ID listed for your VCS in the Available VCS table at the bottom of the agents settings page. Replace the
BB_CLIENT_IDwith the consumer Key and
BB_CLIENT_SECRETwith 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.