Summary: | Install 1 Koha plugin for X Koha instances using the CLI | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Plugin architecture | Assignee: | David Cook <dcook> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | fridolin.somers, martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23191 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25672 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28498 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30999 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
WIP
WIP |
Description
David Cook
2020-06-04 00:20:53 UTC
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 |