grav icon indicating copy to clipboard operation
grav copied to clipboard

GPM Plugin Freeze and Install

Open MaZderMind opened this issue 8 years ago • 13 comments

When setting a Grav-Isntallation up in a Repo, it would be useful to have some way to bin/gpm freeze the currently installed Plugins into a file (like we do with the composer dependencies), so that on another machine (production, ci-system, other computer) a single bin/gpm install would install all required plugins and themes.

MaZderMind avatar Jun 05 '16 16:06 MaZderMind

That sounds like a cool feature. I like that idea.

rhukster avatar Jun 05 '16 16:06 rhukster

Sort of creating a .dependencies file?

flaviocopes avatar Jun 07 '16 21:06 flaviocopes

@flaviocopes yes, exactly. I'm trying to create a Grav-Site whose state is completely controlled via a git repo, so on any machine I can just git clone && composer install and have a running system.

Currently I dassed the plugins as git submodules, which is not too bad, but as you already have a package manager which is capable of installing and updating, this would be a probably small addon which would make a complete git-based system even simpler.

MaZderMind avatar Jun 08 '16 08:06 MaZderMind

would be cool to create a lock file that contains specific versions of files that can be used by our GPM commands.

rhukster avatar Jun 14 '16 17:06 rhukster

I was thinking about this and like composer and yarn do, it would be nice to get to the point where we can create a dependencies.lock file after GPM install/update that would freeze the list of plugins currently installed as well as the version they are at. Including for Grav itself.

This could help backing up and restoring a lot, as well as moving things across servers or even just putting the bare-bone instance on a git repository, without having to copy over the whole user folder.

w00fz avatar Oct 24 '16 19:10 w00fz

Is there documentation for the .dependencies file format? I'm interested in poking at this issue if nobody else is already doing so.

Perlkonig avatar Dec 21 '16 19:12 Perlkonig

I don't know about a proper documentation for it, it's a learn by example at this point.

flaviocopes avatar Dec 22 '16 08:12 flaviocopes

Time to dive into some code, then. 🏊

Perlkonig avatar Dec 22 '16 14:12 Perlkonig

@Perlkonig where are you with this? I'd like this as a feature as well.

amtur8 avatar Jan 18 '17 23:01 amtur8

I'm new to Grav (thanks for Grav!) and was a bit surprised that nothing related to Grav plugin dependencies had been added to my Git repo after installing the admin plugin. Now I know why. :)

As a workaround and an alternative to using Git submodules, would a viable strategy be to rsync my dev installation's user/plugins directory to my production server's installation on each deploy?

DavidOliver avatar May 12 '17 15:05 DavidOliver

I usually install plugins from the GPM (so, no submodules) and store all the user/ folder in the site repo, so I update locally and just push to update the remote site. In this way, there is nothing to do on the remote than a simple git pull with a post-commit hook.

But I can see it useful storing the current version of the installed packages in a config file, and have a CLI command to sync a site to those versions. Also because for private plugins you don't have the GPM and you'll have a submodule in each plugin (assuming you version control them)

flaviocopes avatar May 15 '17 11:05 flaviocopes

Was this implemented @rhukster ? I am trying to streamline my installs and don't fancy creating these manually times whatever. I don't see it in bin/gpm list.

hughbris avatar May 23 '22 01:05 hughbris

No, this not something we've been looking at. I think Grav 2.x will have quite a different system for GPM.

rhukster avatar May 23 '22 04:05 rhukster