If you ever wondered how you can add a ssh access to another repository of Bitbucket/Github in your Circle CI build agent? It is pretty simple. They currently don’t have a UI to give you, your public key that is generated for you using the nifty button –
Create ... User Key
Here is easy way to get it –
Keep your developer tools open (I am in Chrome). and navigate to
Network tab and make sure you have
Preseve Log selected.
Now, go to project settings in Circle CI, go to
Checkout SSH keys section and hit the button
Create [Username] user key
This will create a new key for you. No in the network tab in developer tools, look for the public key used and copy it. This is your public key.
Now add this public key to the repositories0 that you want to access, including the source repository, if you want to access them without any other trouble.
In the circle ci config, add the new key footprint, to have it loaded inside the agent –
- add_ssh_keys: fingerprints: - "..key fingerprint generated previously when getting the public key"
You should be able to access the other repository now. Copy the SSH public key to as many repository you want to access.