Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,851
Community Members
 
Community Events
165
Community Groups

How to set up workspace-wide SSH keys for Pipelines to fetch Golang modules located on Bitbucket?

Pedro Atlassian Team Sep 06, 2021

Hi, 

I would like to understand how I can set up workspace-wide SSH keys for Pipelines to fetch Golang modules located on Bitbucket, please. 

Thank you!

1 answer

1 accepted

1 vote
Answer accepted

Hi!
Here are the steps to achieve this.

1. Create the ssh key in the pipeline settings for the repo (Repository settings > Pipelines > SSH Keys)

2. Copy the public key to the dependent repo access keys (Repository settings > Access keys)

3. Execute the following command in any context that will need to pull go dependencies. It tells git to rewrite https URLs to ssh URLs:

git config --global url."git@bitbucket.org:<workspaceID>".insteadOf "https://bitbucket.org/<workspaceID>"

4. Also execute the following:

export GOPRIVATE=bitbucket.org/<workspaceID>

This tells golang not to use the public checksum database for dependencies that use that URL.

Vyshakh I'm New Here Feb 02, 2022

@Leonardo M  how do you do the step 1 for all repo pipelines at single place, say at the workspace level. its a pain to manage the ssh keys at each pipeline level, we need it to be at the workspace or the project level. Even the envirnoment variables are not configurable/overridable at project level. are there anything for this?

don't work for me

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,247 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you