getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.54k stars 1.41k forks source link

Feature request: Upgrade Grav to a specific version using Grav Package Manager #3288

Closed gizmecano closed 3 years ago

gizmecano commented 3 years ago

Maybe I missed something but, at this time, it seems that the CLI bin/gpm self-upgrade is not able to use an argument for explicitly specify a definite version.

For version 1.6, the documentation only states that self-upgrade (…) allows (…) to update Grav to the latest available version.

I would like to be able to explicitly state a version and not use automatically the latest available one. Indeed, because of numerous successive recent changes, I would prefer to check plugins interoperability and themes compatibility step by step on a local installation and not directly have to deal only with the most recent release.

Would it be possible to consider in the future such an option, as it exists for Composer? For example, after the version 2 was released, it was still possible to continue updating the previous version by executing composer self-update --1.

w00fz commented 3 years ago

At this time Grav can only update to latest releases, this is by design, to a certain degree, since we always encouraged Grav instances to run latest. And so GPM is not capable of understanding multiple stable releases, only different dependencies requirements. However as we are starting to think Grav2, we most definitely want to provide a way for people to stick to 1.7 and for us to to still be able to provide updates for targeted channels as we move along with 2.0, but this is nowhere in the near future unfortunately.

One thing you can do, though, is to use the direct-install command, bin/gpm direct-install <url> (also available in admin), which will allow you to point to a specific version and perform the installation as you want.

Little known is that all our core/plugins/themes/skeletons downloads can be reached by version. To grab the latest update package you can go to https://getgrav.org/download/core/grav-update/latest ... and so if you wanted to grab the latest 1.6 update version you could reconstruct the url as https://getgrav.org/download/core/grav-update/1.6.31

We are aware how this is not exactly ideal but at least it is a way, right now our goal is to ensure everyone gets on board with 1.7 that has some important architectural and performance updates, but also will ease the process of splitting stable releases when the time will come.

I hope this helps!

gizmecano commented 3 years ago

Hello @w00fz,

Thanks for your detailed response.

One thing you can do, though, is to use the direct-install command, bin/gpm direct-install <url> (also available in admin), which will allow you to point to a specific version and perform the installation as you want.

I think I will probably try this method, which seems to me quite close to the idea I initially had in mind.

I hope this helps!

I hope so too. If this method runs properly, I will close this issue (even if such a feature could indeed be considered for a next major release).

gizmecano commented 3 years ago

(...) and so if you wanted to grab the latest 1.6 update version you could reconstruct the url (...)

So, I used the admin panel with this reconstruction method to update to the last iterations of minor version 1.6 step by step. Everything worked fine, apart from version 1.6.29 which had to be skipped due to the following error:

Error while trying to download (code: 302): https://getgrav.org/download/core/grav-update/1.6.29

I now close this issue considering that the method suggested by @w00fz works properly. I'll let you consider if you want to open it back in case that such a feature will be workable in a future major version.

Thanks for your help. 👍🏼