Configuration Hell problem at Home

in #programming8 years ago

Hello! Today I want to tell about Configuration Hell problem. But not from point of view of professional developer. I want to discuss this problem as a hobbyist. Let me explain.  Look I`m working on my hobby projects from three devices: home laptop (Windows 10), work laptop (Windows 8.1) and home pc (Ubuntu 17.04). 

The problem is how to support synchronized all three environments. First way was using a docker (you can read about this in my past article) but this way allows to deal with the problem only in homogen environment (one base OS). In my situation I must install docker in three different ways (as you may know Windows 10 already have native docker support but Windows 8 doesn`t). 

I think the method that I will explain today is more universal. This method is a composition of three technologies Virtualization (VirtualBox), Automation (Vagrant) and version control (GitHub). I will not describe how to install this products because installation steps described in official manuals. I want to describe the way to use all three products together and it`s result.


Image Credit

The idea is to save Vagrantfile and project files which placed on shared volumes in Github.

Sounds complicated let me explain. Vagrant file is configuration file which describes how to deploy VirtualBox virtual machine with sets of apps that are needed to run a project. This is example of my Vagrantfile.

Vagrant.configure("2") do |config|  

config.vm.box = "hashicorp/precise64"   

config.vm.provision "shell", inline: <<-SHELL     

     apt-get update

     apt-get install -y python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev python3 python3-dev git

     pip install scrapy cd /vagrant

     scrapy crawl commenters -o result.json

     SHELL

end 

 GitHub allows to access to current project from different locations where internet is present.

Now let me show how it looks in commands when you already install VirtualBox Vagrant and Git.

$ git clone https://github.com/Ertinfagor/ContestParticipants.git

$ cd ContestParticipants/

$ vagrant up

$ vagrant ssh

Looks pretty simple. What do you think?

Sort:  

Why not setup a NAS disk on your home network? All files could be accessed by all 3 computers.

Yes it`s a good idea for case where you receive a static ip from provider.