Question

Is it a good practice to include your Vagrantfile inside your project repo?

In that way, I guess that any developer just needs to clone the repo and raise a new vm machine based on that Vagrantfile so he can have a whole dev environment ready, but I don't know if this is a the proper way of managing it.

Thanks in advance, Simon.

Was it helpful?

Solution

Absolutely, you've hit the nail on the head. The whole purpose of Vagrant is to provide an easy mechanism to spin up consistent environments for development.

There are circumstances where you might want to keep your Vagrant config in a separate repository, for example where you're bringing up multiple disparate services to create a complex environment. For any other use case I'd keep the Vagrant file in the main repository.

Another benefit of keeping it in the main repository is it's much easier to have your continuous build system spin up the VM, run the test suite against it, and then bring it down, so you know your VM is consistent AND stable :).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top