Isaac Isaac - 6 months ago 33
Bash Question

Posting a download to bitbucket from a shell script

I'd like to be able to fully-automate the process of packaging the release of an application (in Xcode) via shell script and I'd like the zip archive that is released to be a download on bitbucket. Is there a way to programmatically make a (zip) file available as a download on bitbucket?

Answer

Not sure you can do it with a shell script, or at least it'd be somewhat tough. There is a bitbucket api (http://bitbucket.org/api/) but it looks read-only for the time being.

My suggestion is to use some kind of client-side http/url library in your favorite language to download the .../downloads page, grab all the <input>'s of the form, and repost an upload. You'll want to look into posting multipart/form-data POST's. Other than that, I'm not sure I can be of much help.