Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#4520 closed enhancement (fixed)

Add Download using command line

Reported by: galaktor Owned by: Radek Bartoň
Priority: normal Component: DownloadsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


It would be really great, if there would be any straight-forward way to add a download to the database using the command line (like managing tickets using trac-admin). I would love to use DownloadsPlugin with continuous integration, where the latest build will automatically be added as a new download. I would add a task to CC or Ant to execute whatever command is necessary.

Maybe it could work something like this:

trac-admin [projectlocation] add download [attributes]... [pathtofile]

Removing a download could work the same way, using "remove" instead of "add".

If the path to the file is relative, then DownloadsPlugin looks within the downloads cache defined in trac.ini. It can also be absolute, meaning anywhere on the server.

This would be an awesome addition to DownloadsPlugin!

Attachments (0)

Change History (9)

comment:1 Changed 9 years ago by Radek Bartoň

Status: newassigned

I agree. Futhermore, it won't be too hard to implement with current Trac architecture. But currently I'm pretty occupied...

comment:2 Changed 9 years ago by galaktor

Any progress on this subject yet?

comment:3 Changed 9 years ago by Radek Bartoň

Not yet, sorry. But I may try on the weekend.

comment:4 Changed 9 years ago by Radek Bartoň

Oops, I thought that trac-admin is extensible via extension points but it isn't. I can implement new script, let's say, which does the same as trac-admin but which can add downloads too. Would be that fine?

comment:5 Changed 9 years ago by anonymous

Yes, of course. As long as I can integrate some command into my build automation scripts, I do not really care what I actually have to call :-)

comment:6 Changed 9 years ago by galaktor

(The previous post was done by me, but I forgot to add my name...)

comment:7 Changed 9 years ago by Radek Bartoň

I added another comment to this topic recently but either I didn't submit it or I posted it to another ticket :-). The meaning was that I noticed that previous is true for Trac 0.11. Trac 0.12 has already extension points for trac-admin. So I created 0.12 branch of the plugin and started to implement this feature there. Do you plan to use Trac 0.11 for a long time?

comment:8 Changed 9 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Implemented for Trac 0.12 with r5598. If your desperately need this for Trac 0.11, please, reopen the ticket.

comment:9 Changed 9 years ago by Radek Bartoň

Ah, I forgot. Some notes before it will be documented. module was splitted to and Enable/disable proper components accordingly. If you want to set tags of uploaded downloads, you have to set consoleadmin_user option in trac.ini to user with TAGS_MODIFY permission.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Radek Bartoň.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.