Hi All,
bitbucket is very good program for learning programming. I was trying to automate bitbucket ssh keys addition in our bitbucket repo setup. As i am aware of that we add the ssh keys through bitbucket web url after copying from end points but i would like to know where those ssh keys are saved (in db or file )which we save through web url so that i dont have to manually add for each endpoint rather i can automate the solution .
Thanks
Hi @ryan gnatt ,
It seems you are referring to Bitbucket Server. If so, you could call Bitbucket's REST API to add the SSH key - https://docs.atlassian.com/bitbucket-server/rest/6.6.0/bitbucket-ssh-rest.html
In case you want to get a list of Projects, Repositories you can refer to https://docs.atlassian.com/bitbucket-server/rest/6.6.0/bitbucket-rest.html . With that, you could simply iterate over all the repositories you need and place the SSH key using the previous URL.
If Bitbucket Cloud is what you are looking after, the have a look at https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/ssh-keys
Kind regards,
Rafael
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.