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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.