-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force install of specific WordPress version #28
Force install of specific WordPress version #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR :) Are there any potentials for data loss with this? I'm wondering if it's better to add a force_wp
parameter, and then warn the user if the WP version they chose and the WP version they have are different? Anything we can do to make things more informative for the user and set expectations as to how things will work is great
Given that the default value of WP_VERSION is defined at the top as latest
, a skim read would suggest this means that the latest version of WP gets reinstalled over the top on every provision
There shouldn't be any potential for data loss, but good call on the unnecessary call since |
And don't forget to update the readme :-D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me is ok, waiting for a review from @tomjn
I am wondering what is the difference with https://github.com/Varying-Vagrant-Vagrants/custom-site-template/blob/master/provision/vvv-init.sh#L103
|
I think the difference is being able to downgrade to a specific version of WP if needed. For example, if something is only breaking in one version of Core (the version used on production and the client doesn't want to update for some reason or is roadblocked by testing) the user could just update their config and reprovision instead of having to ssh into the VM. If it's better to just move the logic up I'm happy to update the PR 🙂 |
I am only wondering if it is a duplicate code because as I can see will be executed first the update (with a specific version) if the website is installed at https://github.com/Varying-Vagrant-Vagrants/custom-site-template/blob/master/provision/vvv-init.sh#L103 and later again. So maybe is more simple to check in that line what is the wp version (wpcli can already do it without the bash snippet) and check if wp-version is different (configured in the yaml) and install it. Sorry for this analysis now but it was a busy day today and I didn't had time to analyze everything carefully.
|
Good point, @Mte90! That approach sounds much cleaner. I've updated the PR to reflect this. |
Sorry I checked again the code and I discovered that now in WP-CLI core is not possible to define what WP version to install with The issue is that we are installing on first provision, at second we downgrade with the update command, so is better to install wp already with the right version to avoid a second provision. |
Also we are downloading the wp version https://github.com/Varying-Vagrant-Vagrants/custom-site-template/blob/master/provision/vvv-init.sh#L38 specified in the config.
|
And nevermind it was right as it is now, it' only me that need to learn to be more focused during reviews... |
Apologies, @Mte90! I was wrapped up in client stuff all day and was just able to check on this PR. Thanks for the review and merging :) |
Check if wp_version in configuration and upgrade/downgrade the site if set regardless of if the site is already installed.