Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding files to redmine via command line

We have an automatic build system that spits out packages, regression-tested & wrapped into a neat installer, ready for end-users to d/l & deploy. We do tracking of end user support requests/bug reports via redmine. So far we uploaded the packages manually to the resp. 'Files' section of the redmine project, via the web interface.

What I'd like to do is to automate this step. I imagine this would requires a few lines of Ruby to interface with redmine's db. I have zero knowledge about redmine's internals. :)

Basically I want the equivalent of a

mv package-x.y.z.tbz /usr/local/redmine/files/

as a Ruby (or whatever language suits the need) script that creates the right filename and registers the file in redmine's db so it shows up as if it had been uploaded through the Web interface, manually.

Cheers!

like image 338
the Ritz Avatar asked Jun 30 '10 21:06

the Ritz


1 Answers

I've been frustrated with Redmine about things like this before. But before I go much further: is there a specific reason why you're using the Files section for this? It seems another tool (such as SSH/SFTP for uploading to someplace accessible to HTTP) might be a better fit for your needs. It would also be easily scriptable. Just point people to some constant URL like http://yourcompany.com/productname-current.zip.

If you really need to use Redmine for managing this, you might check out Mechanize: http://mechanize.rubyforge.org/. They should have a RESTful API also, but I've never used it.

like image 54
Benjamin Oakes Avatar answered Sep 24 '22 13:09

Benjamin Oakes