Skip to content
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

Rely on running wp-development-up instead of custom Vagrantfile code #165

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

ottok
Copy link
Contributor

@ottok ottok commented Jan 10, 2021

The code in the Vagrantfile is bloated and obsolete anyway, it should
simply be running wp-development-up after the Vagrant box is up so
that all imports and pulls etc run correctly inside the Vagrant box without
depending on the Vagrantfile contents. This makes the project template
also better compatible and unified with using Docker.

Related: #164.

@ottok ottok requested a review from elguitar January 10, 2021 20:02
Copy link
Contributor

@elguitar elguitar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran vagrant up with both the master and this branch. The outputs didn't differ much.

However, I was not able to pull stuff from production, because the interactive session is not detected in wp-development-up:

Not an interactive session, skipping all questions and resorting to default values

This is probably a bug with wp-development-up and it should be fixed before merging.

@ottok ottok changed the title Rely on running wp-development-up instead of custom Vagrantfile code WIP: Rely on running wp-development-up instead of custom Vagrantfile code Jan 27, 2021
@ottok
Copy link
Contributor Author

ottok commented Jan 27, 2021

Seems Vagrant does not support running commands and sending any kind of input to them, so wp-development-up would always run non-interactively. Thus we need to keep duplicate code in Vagrantfile and wp-development-up.

From https://www.rubydoc.info/github/mitchellh/vagrant/Vagrant/Plugin/V2/Communicator#execute-instance_method

This method gives you no way to write data back to the remote machine, so only execute commands that don't expect input.

@ottok ottok added the wontfix label Jan 27, 2021
@ottok ottok changed the title WIP: Rely on running wp-development-up instead of custom Vagrantfile code Rely on running wp-development-up instead of custom Vagrantfile code Jan 28, 2021
@ottok ottok requested a review from elguitar January 28, 2021 15:07
@ottok
Copy link
Contributor Author

ottok commented Jan 28, 2021

I think I solved this now by simply running wp-development-up via a system call, they are interactive.

This works now:

  1. vagrant up
  2. vagrant ssh -c 'wp option set blogtitle testi'
  3. verify on https://wordpress.local that the title changed
  4. vagrant destroy
  5. vagrant up
  6. verify on https://wordpress.local that the title is still there as changed

By triggering wp-development-up the wp-vagrant-load-db gets triggered correctly and database from shutdown dump is used.

@ottok ottok removed the wontfix label Feb 1, 2021
The code in the Vagrantfile is bloated and obsolete anyway, it should
simply be running wp-development-up after the Vagrant box is up so
that all imports and pulls etc run correctly inside the Vagrant box without
depending on the Vagrantfile contents. This makes the project template
also better compatible and unified with using Docker.

Related: #164.

Also clean away some extra output to avoid excess verbosity.
@ottok ottok merged commit df58783 into master Feb 2, 2021
@ypcs ypcs deleted the feature/wp-development-up branch July 19, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants