8 ms·
A Better Development Workflow with Vagrant
- zjmichen 14y agoPretty similar to my workflow, but why do you destroy the box after every session? `vagrant up` on my laptop takes a few minutes at least to build and provision a vagrant machine. Usually I just use `vagrant suspend`. Seconds vs minutes. Time > organization IMHO.
- brokenparser 14y agoOf course, but if you do that please also use a CI tool (such as Jenkins) to ensure the Vagrantfile stays valid. It's actually good to rebuild that VM regularly, especially when it's almost time to deploy.
- zjmichen 14y agoYeah, close to deploy is different. What does a CI tool do in this case? I'm somewhat unfamiliar with the concept.
- jmcqk6 14y agoIf you run your tests in a pristine and isolated environment, then you can be more confident in the lack of side-effects. Basically, by integrating this into your CI tool, you ensure that all your tests / deploys run through a standardized and pristine environment.
- mateuszf 14y agoI haven't done it myself, but I've heard that the same effect (clean starting point) can be achieved with snapshots and restores without the waiting time - it is supposed to work very fast.
- taylorlapeyre 14y agoNo particular reason other than freeing up the disk space that the VM uses (which admittedly not much).
- dgh 14y agoor 'vagrant halt'
- pibefision 14y agoAnyone has experience using Vagrant with VMWARE?
- tjbiddle 14y agoThey just released support for this the other week I believe (Or at least very recently) - And that is specifically why I've been catching up on everything Vagrant lately, as I was specifically waiting on VMWare support. I asked about it in the freenode #vagrant channel the other day and everyone said it should work the exact same as using the VirtualBox provider - except with VMWare.
- dave1010uk 14y agoDoes VMware do anything VirtualBox doesn't?
- mitchellh 14y agoIt does everything better. NOTE: I'm biased, I created Vagrant + VMware. But go ahead and ask VMware users.
- nazka 14y agoI want to say something like that one day :)
- rschmitty 14y ago+1 for VMWare, havent crashed yet after a year and a half since switching thanks for your Vagrant + VMware work, that was the biggest thing keeping me from vagrant
- taylorlapeyre 14y agoHey there, author of the article here. Just wanted to thank you for your help in closing the issue that I opened about adding GOW support on Windows. It's nice to know that Vagrant has an active and supportive community.
- bti 14y agoDon't know if I understand. You have the one develop box with all the languages/server/databases on there. Then when you decide to start a PHP project, you keep a copy of that box in with the project files? Doesn't this result in multiple boxes sitting around? Or does the Vagrantfile specify the environment and when you vagrant init develop it recreates it? I've never used Vagrant but am interested in starting to do something like this.
- taylorlapeyre 14y agoThe Vagrantfile specifies the enviroment, and vagrant init develop creates a new Vagrantfile with the base vm specified as "develop". There's only one box, and you add it to vagrant with "vagrant box add develop path/to/develop.box". After that, you can delete the develop.box file from your computer: it now exists somewhere in the nethers of vagrant's configuration.
- bti 14y agoSo as you find new tools you want to use, do you just update your develop box? Do you have an example of a Vagrantfile you used for a project? I guess the main thing I can't get is say I have custom nginx settings or MySQL settings I need in a project. Do I setup those through Chef? Thanks for the article, lots to look into.
- taylorlapeyre 14y agoIt depends. If I begin using something new (say, Go) and end up using it a lot then I will install it on develop and repackage it into the "develop" box again. This takes about 5 minutes. If it's something specific for a project (i.e., a jekyll website), I just write a quick shell script to install jekyll in the Vagrantfile for that project instead of repackaging the whole box. As for your second question, yes, you would have a specific Vagrantfile/box for a project where you need a specific enviroment. My "develop" box is a general case. Here's a (slightly modified) example of a Vagrantfile that I use with a project: https://gist.github.com/taylorlapeyre/5399974 https://gist.github.com/taylorlapeyre/5399974
- 14y ago
- jtreminio 14y agoI haven't used Vagrant, and I believe I now know why.My daily driver is Win8.I have a Debian VM I do my development on.All files are on the VM because Windows sets all file and folder permissions to 755. This means that if I were to delete the vagrant VM I would also be deleting my files. I am exploring possible solutions to this problem.
- limeblack 14y agoSimilar set up, but I use Cygwin so I can run `startxwin` then run `ssh box -Y` and have have all my applications/workflow running in the Windows taskbar.
- AjithAntony 14y agoAre you saying that when you share a filesystem between your windows 8 host and the Debian guest, that files written from windows have bad perms?
- jtreminio 14y agoIf the files reside on the NTFS Win8 partition, they show up as 755 on Debian. If the files reside on the ext3 partition on the Debian VM, the permissions are fine and even editing the files from Windows, on a Windows IDE does not change the permissions.
- AjithAntony 14y agoJust to clear up my expectations, if I were to try a similar set-up... When you are using NTFS I'm expecting that you are using virtualbox to mount the filesystem on the guest. When you use etx3, how are you sharing the files? Like a samba share? or does the virtualbox drive mount work in the other direction, somehow? FWIW, I do all of my virtualization on ESX, but every time one of these vagrant article comes up I'm tempted to try something local (win 8), to take advantage of the shared filesystem that most of vagrant's magic relies on (as I understand).
- 14y ago
- artur_roszczyk 14y agoI would go even further and store tmux+vim config inside
- lojack 14y agoI would go even further and use the same provisioning on vagrant as on my production servers so I could set up a mini production environment with whatever dev tools are necessary with just a single command. Recently they added the ability to have multiple machines as well, so all it takes to load up a simulation of my cluster is a single command.
- juliendsv-mbm 14y agoIf you have a mac I recommend to have a look at the boxen project from github.
- taylorlapeyre 14y agoI did actually look into that, but it kind of did the exact opposite of what I wanted. There's a few reasons I'm not too impressed with Boxen: - Its goal is to install a whole bunch of binaries and development utilities onto my local machine. I want to keep those segregated. - It only works with Macs. My only computer at the moment is a mac, but it's not always what I use. I use computers at work that are linux based. - I found that it was buggy. I wasn't very easy to get it actually working. It required a lot of effort and installation. So, Boxen isn't for me.
- thecodemonkey 14y agoI recently built out a base LAMP stack for Vagrant, using Chef for provisioning if anybody's interested in getting up and running quickly. https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack