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

Fetching file with curl with 2 factor authorization enabled

denis_z_infinum June 6, 2017

I am trying to fetch a file from a private repository, a shell script. And I'd like to run it immediately.

I tried with 

curl --user username:pass https://repo_path/file.sh | sh

But I don't get anything. I even tried putting app password, again, nothing.

I tried with 

curl https://user:password@bitbucket.org/repo_path/file.sh | sh

No luck.

 

Any ideas how should I do this?

 

I'm doing this so that the new users can just paste this line in their terminal, and the script will set the project up for them (clone the repo among other things).

1 answer

1 accepted

0 votes
Answer accepted
denis_z_infinum June 6, 2017

Ok, I managed to do it, by doing a request to the Bitbucket API, with the correct endpoint and app password.

 

curl -u username https://api.bitbucket.org/1.0/repositories/user_repo_name/repo_name/raw/master/file.sh | sh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events