I want to create the following: koha-plugin-install <instance> <plugin.kpz> You'd have 1 KPZ package, and you'd be able to add/upload/install it into an instance from the command line. This would allow a sysadmin to easily automate the installation of plugins across Koha instances from the server side.
It would also be interesting to use "koha-plugin-install <instance> <http://repo.org/releases/plugin.kpz>" That could make plugin management even easier.
Actually, I think the syntax would be "koha-plugin --install <plugin> <instance1> <instance2>"
Turns out that the easier way to do this was to create "misc/koha_plugin.pl" which will be called by koha-plugin... koha-shell -c "perl misc/koha_plugin.pl --uninstall Koha::Plugin::Com::ByWaterSolutions::CoverFlow" kohadev
koha-shell -c "perl misc/koha_plugin.pl --install https://github.com/bywatersolutions/koha-plugin-coverflow/releases/download/v2.4.35/koha-coverflow-plugin-v2.4.35.kpz" kohadev koha-shell -c "perl misc/koha_plugin.pl --install https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.39/koha-plugin-kitchen-sink-v2.1.39.kpz" kohadev koha-shell -c "perl misc/koha_plugin.pl --uninstall Koha::Plugin::Com::ByWaterSolutions::CoverFlow" kohadev koha-shell -c "perl misc/koha_plugin.pl --uninstall Koha::Plugin::Com::ByWaterSolutions::KitchenSink" kohadev
I'm also going to make it so that you can provide a KPZ file or an unzipped KPZ, so misc/koha_plugin.pl will be very flexible in terms of inputs. The Debian script koha-plugin will download plugins over HTTP/HTTPS, and then unpack downloaded/local KPZ files into a staging directory. The staging directory will then be copied to each instance specified. It should be pretty sweet. I want to add enable/disable options as well at some point, but that's not critical yet.
The following would work too but it wouldn't be efficient with a KPZ file or a HTTP(S) URL, because it would be re-downloading and/or re-unzipping every time: koha-foreach perl misc/koha_plugin.pl --install https://github.com/bywatersolutions/koha-plugin-coverflow/releases/download/v2.4.35/koha-coverflow-plugin-v2.4.35.kpz koha-foreach perl misc/koha_plugin.pl --uninstall Koha::Plugin::Com::ByWaterSolutions::CoverFlow That said, it could be done with an unzipped plugin. That could be interesting. You wouldn't even need a KPZ file. You could point it right at a git checkout for instance. (That could actually be really useful from a Koha plugin development point of view as well.) -- Perhaps I should rename misc/koha_plugin.pl to misc/koha_plugin_manager.pl. -- A goal of mine is to use this management feature to actually install a Koha Plugin for all my many libraries which is itself a Web-based Koha Plugin manager (inspired by the "Game Package Registry for Unity release" from Google for the Unity IDE). That Web-based Koha Plugin manager will then easily let Koha intranet users decide which plugins they want to install, but it'll only include a list of curated plugins. Alternatively, I might use this management feature to install Koha plugins which used to be local customizations, and popular third-party plugins like Bywater's CoverFlow. Ultimately, I think we need a tool like this for dealing with plugins on any kind of scale that becomes manually unmanageable (e.g. 40 instances, 80 instances, etc.)
The code is still WIP, but I probably won't get back to this for a week or two. Looking forward to getting back to this though.
Created attachment 107210 [details] [review] WIP
Created attachment 107211 [details] [review] WIP This is just my current work in progress. It's nearly done, but I haven't had time to complete it yet.
*** This bug has been marked as a duplicate of bug 28498 ***
I didn't know or heard about this before. Will be looking at this code.
(In reply to Tomás Cohen Arazi from comment #11) > I didn't know or heard about this before. Will be looking at this code. <3