Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download a File from the Download section of Bitbucket Repo using Access key

I'm looking for a way to download a file from bitbucket, (not the repository, a file from the download section). Currently, it is possible to clone a repository using a deployment key, but I couldn't make it work for downloads.

I have tried the following:

curl -u username: --key .ssh/id_rsa --pubkey .ssh/id_rsa.pub scp://bitbucket.org/repositoryowner/downloads/downloadfile.zip

EDIT:

The current best workaround is to create a throw-away dummy user:

wget -O /tmp/file --user "username" --password "password" https://bitbucket.org/owner/rep/downloads/abc.tar.gz

like image 848
code_ada Avatar asked May 26 '16 14:05

code_ada


1 Answers

After a bunch of failed attempts, I received this response from Bitbucket support:

Access keys in Bitbucket Cloud can be used for cloning or pulling from a repository only, I'm afraid it is not possible to download files from the Downloads section of the repo with SSH keys.

Unless the repository is public, users will need to have a Bitbucket Cloud account in order to authenticate and download files from the Downloads page.

Feel free to let us know if you have any further questions.

This has now been made a feature request on Bitbucket. If you want to have this functionality, then upvote it:

https://bitbucket.org/site/master/issues/18501

like image 188
bremen_matt Avatar answered Nov 13 '22 04:11

bremen_matt