Tuesday, June 22, 2010

How to set up a flexible, efficient dev environment for any platform

If you're like me, you've probably tried to figure out the best possible way to use a mac (or PC) for editing your code, and then run the code on a platform on linux (most likely LAMP).

The default solution is to have an SVN checkout on your mac/windows machine. In order to test your code, you would have to commit it to svn, go over to the linux setup, do an svn up, and then finally be able to refresh the page to see the changes.

I found that this mechanism takes way too long. The code/test cycle can be very painfully slow

Here's a solution I figured out. Perhaps it might help you out:

1. get VirtualBox. It is free and easy to use.
2. load it up with your favorite flavor of linux ( I prefer Debian or Ubuntu) to run your platform on.
3. hint: make an image out of it and share the image amongst your other devs.
4. run the linux image as a guest machine on top of virtualbox
5. make sure your mac/pc can connect to the guest machine
6. Install samba on your guest machine and expose your code's root directory via samba. on windows, be careful with this. on windows, you have to use the exact same username/password on linux/samba as your windows user and as your linux user.
7. create a samba mount from your mac/windows that points directly to your linux guest machine
8. now you can edit files from the samba mount using your favorite IDE, save, and then refresh the page to test.

I found this to be a hugely efficient system once it's set up. there are a few snags you might run into while setting it up. But once done, it's well worth it.

If you run a large dev team, it might be worth it to run a vm server that knows how to link up everybody's VMs and ensure that they have the same configs/etc

No comments:

Post a Comment