Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to download a file from bitbucket downloads during pipelines

JJ지우근 November 10, 2021

Hello,

 

I am writing bitbucket-pipelines.yml for my android project.

Once the build starts, it is ncesscary for a certificate to be downloaded from Bitbucket downloads that I uploaded manually.

I tried a command as below but this does not work.

curl -s -L https://${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/myfile.cert

For your information, the environment variables($BITBUCKET_USERNAME) and $(BITBUCKET_APP_PASSWORD) are already added.

Can anyone provide the command so that I can add it to my script?

 

 

 

 

1 answer

1 accepted

3 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2021

@JJ지우근  hi. Thanks for your question. Try with the next command:

curl -s -L -O -u ${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD} https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/myfile.cert

Regards, Igor.

JJ지우근 November 15, 2021

Thanks for your answer.

It helps me a lot

Ashwini Soni
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 25, 2024

This url is not working. The file that gets downloaded is empty even though it has content.

Like Akshay Gollahalli likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events