Closed kadamwhite closed 5 years ago
Few options for this, there’s a vagrant hooks plugin that lets you add triggers and hooks on various vagrant events. I’m not sure there’s a way to know if a machine is already provisioned otherwise unless your extension checks for a file it adds first so I’d say doable with an extension.
I’d probably make it part of the test script myself though.
FWIW, that’s how Chassis does it internally (/etc/chassis-...
files) so you could potentially use that.
I just realised @kadamwhite built an extension for this: https://github.com/kadamwhite/chassis-wxr
@kadamwhite Would you like to move that into the Chassis organisation and I can update it for Bionic Beaver too. Thanks! 🙇♂️
A common use I have for VMs is as an integration test environment, for example kadamwhite/wpapi-vagrant-varietal which is a basic VM that spins up a WP site and seeds it with a WXR file. Setting up a theme testing VM with sample content would be another example.
I could replicate that with chassis if we had an extension to install a WXR on first boot; not sure how we'd make it not re-import and create duplicate content on every subsequent provision or this seems like it would be pretty straightforward.