Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#4520 closed enhancement (fixed)

Add Download using command line

Reported by: galaktor Owned by: Blackhex
Priority: normal Component: DownloadsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

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 6 years ago by Blackhex

  • Status changed from new to assigned

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

comment:2 Changed 5 years ago by galaktor

Any progress on this subject yet?

comment:3 Changed 5 years ago by Blackhex

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

comment:4 Changed 5 years ago by Blackhex

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

comment:5 Changed 5 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 5 years ago by galaktor

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

comment:7 Changed 5 years ago by Blackhex

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 5 years ago by Blackhex

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:9 Changed 5 years ago by Blackhex

Ah, I forgot. Some notes before it will be documented. admin.py module was splitted to webadmin.py and cosoleadmin.py. 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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.