Magento – Magento Development Setup

developmentenvironment-emulation

this question is directed towards setting up the development environment.
I have some specific requirements:

  1. I want to be able to use my solution under Linux, Windows and Mac OS, since people of our team use all these OS (e.g. front end developers use Windows / Mac, back end developers mostly use Linux)
  2. I need to use modman
  3. I need to use composer
  4. I need to use Github as well as my private Git repositories
  5. I need a proper IDE like Netbeans or PHP Storm
  6. I want very good performance

My current setup is a virtualized Ubuntu image within Virtualbox.
All three OS can run Virtualbox, so points 1) – 5) are all satisfied.

However, currently, I am not completely satisfied with 6).
This is especially true when running the solution from within Ubuntu 12.04.
The Virtualbox seems much more stable and responsive under Windows 7.
However, many people in our team are using Linux, so I would like to improve the solution.

Does anyone have a comparable setup in VMWare or maybe even docker.io and can report whether it runs more stable?
Or does anyone have other comparable solutions / ideas?

Best Answer

I use vagrant, git and some build script on phing. The vagrant machine run database and web server, git used locally to track changes in my extensions and build script used to update /var/www directory on my vagrant machine (well actually it used everywhere where i need to build an environment).

Phing

Probably most interesting part is phing, which work like modman + composer for me. It has few targets defined including build, setup and install.

The build target download certain version of magento (specified in build config) from internal webserver and extract it into build directory. Then run other targets which setup permissions for files and cleanup the cache. Then it create symlinks to all files in the source directory. In result I get all files ready to use in my build directory. If magento core files already in build directory it skip downloading and just update symlinks, so I use this target to rebuild environment everytime I need to update symlinks. For vagrant machine source directory is in /vagrant/src (shared folder) and build directory is /var/www.

The install target download and import database dump for certain magento version. Then run setup target.

The setup target just create a local.xml file with all settings.

In my company we use unit testing and CI tools, so this way to build a magento environment allow us to test our extensions on different versions of magento, and run it with and without installing.

I have created a "shortcut" on vagrant machine which simplify access to build. For example to rebuild project I need just type vagrant ssh -c magebuild and it's automatically run phing in /vagrant directory.

Then I have assigned this command to certain key combination in my PHPStorm IDE and now I can rebuild project just by pressing Alt + B in my IDE. But since I use symlinks it's not really often operation.

Vagrant

A box for vagrant it's my own box with Ubuntu 12.04 on board, it's actually just standard precise 12.04 with all software preinstalled + shortcut and some configuration. In vagrant file I put just port forwarding settings, private network to be able to use xDebug and put build shortcut to provisions.

GIT

In git I track only my extension files, build.xml for phing and Vagrantfile. So everybody who want to create an environment can just clone repository, and run vagrant up. Then he will get VM up and running ready to work. All this process takes 1-2 minutes. If you want to build project locally (without using VM) you can run phing build install.

Related Topic