I have two computers (1 Laptop with Ubuntu that I use for development in 99% of my time but I also have a pretty much unused PC with Windows. I also have an unused server machine at home. I would like to use my PC for development actively because it has 2 monitors which can be extremely useful when speed is important in development.
I already have a Vagrant machine on my laptop (yes, development machine in a development machine) but it is like 50GB now which is hard to sync, even on local network. I thought of versioning my box with the server but I couldn’t find any other method but uploading it and downloading it.
I thought of versioning just my files with Git to the server but I use lots of custom softwares that I don’t want to bring with me on a pendrive every time I go upstairs to my PC.
The stuff I need to sync:
- node.js dependencies with -g attribute (not installed locally into the source)
- PHPStorm configuration (build and layout)
- My latest commands in the terminal (I do lots of security stuff and I like to roll back to my last used commands if I found them with hard work
- Other smaller programs
- AND of course my Gimp configuration which looks 80% like PhotoShop.
Lots of these things are not on Vagrant (eg. PHPStorm) but I still need to sync them. I have enough hardware to build multiple servers if needed but I would like to keep the two computers in sync. I can install Ubuntu on my Windows machine if needed and I am open to any option that is less effort than copying 50GB to a server and then downloading it each time I change machines.
2
What you’re describing (in part) is automating the configuration of an environment. There are plenty of tools out to help with this; Puppet, Ansible, Chef to name but three.
Configuration involves making sure that the environment that your application is running in contains all the things it needs: packages, services, files, users. You could do all this by hand, but that’s time consuming and error-prone. Instead, you should automate it.
The code for most (all?) configuration automation tools is plaintext, which is perfect for version controlling.
As a bonus, Vagrant supports a bunch of provisioning tools out of the box. By version controlling both your provisioning code and the Vagrantfile
, you can completely automate the creation of an environment to run your application in.
But what about my IDE and such?
What you’re describing, in part, is having a reproducible development environment. This can be achieved by separating the environment for you application (using Vagrant and automated configuration) from that of your machine.
Once you’ve automated your application environment, you have a couple of options for making a reproducible development environment:
- Create an image of your primary machine, and restore that on to other machines. When you make changes to your primary machine, recreate the image and redeploy it to other machines.
- Use a configuration automation tool to take a fresh install of the OS up to a desired state.
For plaintext configuration files (like those for PHPStorm), you can store them in version control and check them out as you setup the development environment.
1