Uploading Artifacts to Bitbucket Downloads Section via Terminal

If you’re using BitBucket for hosting your repo remotely , one common thing you might have done would be to upload the artifacts(apk , jar etc which are outputs of your build process) manually using BB’s web interface .

It can be done via terminal also . BB exposes an API for that. Find it here .

Example :

I’m developing an android app and after each build I wanna upload my app-debug.apk generated to Downloads section so that QA team can do their testing .

I put this command in a file called upload.

curl -v -u charany1 -X POST  https://api.bitbucket.org/2.0/repositories/my_team_name/repo_name/downloads -F files=@app/build/outputs/apk/app-debug.apk

Make it executable .

chmod +x upload

Now , you can execute it after every build from terminal itself.


Leave a comment

Filed under Productivity, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s