Announcement

  •  » Requests
  •  » Automation of installation

#1 2016-07-24 20:39:44

5nafu
Member
2014-10-23
4

Automation of installation

Hi @ll,

with one of the latest trends in IT being automation and continuous delivery ("phoenix hosts", docker, vagrant,... to name just a few technologies) I'd like to be able to easily test and recreate my piwigo installation.
I concur that you might not want to have all albums or comments in a version control system, but I bet that quite a few have customized themes or plugins.
And even if you do not customize those in itself, even the information which plugin or theme is installed and activated is sometimes hard to come by if the server crashed.

With automation you could easily check as well if an OS upgrade or change of hosting provider will succeed, or if it will break you accustomed gallery.

It would be a great start if one could automate the installation and Activation of:
* Piwigo itself (can be done with either a POST-Request or with How to initialize piwigo from command line.)
* Plugins
* Themes

I know I can download plugins and themes from http://piwigo.org/ext/, but there seem to be no easy way to activate the installations, is there?

Did anybody successfully install a plugin via a command line or even curl?

Cheers,

Snafu

Offline

 

#2 2016-07-24 21:30:05

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: Automation of installation

Hi 5nafu,

For sure you can automate Piwigo installation. This is what we do on Piwigo.com ;-)

For plugins, see method pwg.plugins.performAction on http://piwigo.org/demo/tools/ws.htm : you can activate a plugin that is already in the "plugins" directory. However, it doesn't "download" the plugin from piwigo.org/ext

Offline

 

#3 2016-07-27 12:31:59

5nafu
Member
2014-10-23
4

Re: Automation of installation

Hi plg,

thank you for the hint to the API. That is exactly what I needed. I just have a few more questions, if you (or somebody else) would like to answer, that would be great :-) :

One point I gather from your answer is, that I would need to download the plugins and install them manually on the system. Is there a generic link for "download the latest version of plugin foobar"? Or is there an API to PEM from which I could get the latest version (string) for the plugins? I didn't find anything in the referenced PEM Doku.

Another Issue I ran into was the method "pwg.session.login" with the API. As I understand REST, it is a stateless protocol. Therefore I expected a kind of session token in the response. Instead I need to save the cookie and add it to every request.
Am I mistaken, and you could add the pwg_token somehow to your requests? And how can I receive the token used to login?

Last but not least, I created a pull request for the issue:#406 ([Github] Piwigo issue #406) . After commiting I saw an error coming from jquery concerning the contenttype in ws.htm. It seems that jQuery puts the response into an object instead of a string if the contenttype "text/json" is used. I fixed it in this file, but found some references in admin/themes/default/template/user_list.tpl, admin/themes/default/template/cat_modify.tpl, admin/themes/default/template/photos_add_direct.tpl. Is there a way to test these files? I could not find an issue with my test installation, but might not be looking at the correct location.
If everything is in order, I would be happy if somebody could merge the pull request #510.


Cheers,

5nafu

Offline

 
  •  » Requests
  •  » Automation of installation

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact