I would like to add some automation to our build process, and I'm curious if it's possible to use an SSH access key to download a specific tag (or commit, or branch, etc.) in our repo?
I realize that in the Bitbucket web GUI, I'm able to go to Downloads from the repository's page, choose the tag that I want and download either a .zip, .tar.gz or .bz2 archive of the source code; but I'd like to do this via software using SSH.
I know that I could use HTTPS with a URL-encoded username and password (e.g. https://user:password@bitbucket.org/user-name/repo-name/get/master.tar.gz ) to download the tag, but that would require me to put a user's username and password into our code, which isn't ideal. It's also not ideal to clone the whole repo and checkout the tag I need, since the whole repo may be significantly larger than just a single snapshot of the source code.
Is it possible to do this?
Hi Jeremy,
I am not on the Bitbucket Team, but I will try to help.
I think you can do this using a git client.
Eg.
git checkout tags/<tag_name>
That way you can create a unique SSH key in BitBucket for your automation. You keep the privateKey where you git client can access it and upload the public key to BitBucket. https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
I hope that helps!
Hi Martyn,
Thanks for the response. Unfortunately, as I noted in my question:
It's also not ideal to clone the whole repo and checkout the tag I need, since the whole repo may be significantly larger than just a single snapshot of the source code.
That solution is a possibility, but it's not quite what I'm looking for.
Jeremy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.