Forums

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

Download Bitbucket tag with SSH key

Jeremy_Villa March 6, 2019

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?

1 answer

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

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!

Jeremy_Villa March 7, 2019

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

Like Marty likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events