Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Possible for a script to add a pub key to a repo?

James McGrath March 17, 2019

I've been tasked with the goal of creating on fully scripted setup for new staff computers and one of the ideas that has been brought up was having the script automatically clone repos for projects that staff would be working on. The easiest way to do this would be to generate a key pair and somehow add that public key to each repo, which is where I'm stuck. Is this something that can even be accomplished?

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2019

Hello James,

The idea around automating the process for new staff members to be able to quickly have access to their work is a great idea. The ideal method you could use for adding SSH keys would be the REST API. There are two endpoints which may be viable for you to use within your scripts. You may find these endpoints here:

The above endpoints should allow you to import SSH keys into Bitbucket to then allow you to clone a branch or repo for the users.

If you run into any issues, please do let us know.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events