How do I connect Velocity to my on-premise Bitbucket Cloud?
Setup
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."
E.g. https://bitbucket.org/company-name/workspace/settings/api
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.
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:
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 theBB_CLIENT_ID
with the consumer Key andBB_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.