LimeSoda Environment Configuration

This article is part of a series covering 3rd party n98-magerun modules/extensions.

The next article presents a solution to manage several developer, staging, production environements with a n98-magerun module and and a Magento module (can be installed at once).
If you have multiple Magento environments i.e. for all your developers you know the problem. Someone dumps a database and share it with another developer. Now every developer runs in the same boring issue. Changing the configuration according to the current environment. The list of configurations grows and grows… You know the problems.

At this point the solution of Limesoda can help you.

Installation

You need to install the file directly in your Magento installation via modman.

After the installation you must define the name of your config environment. This can be done in config.xml (in this case
the app/etc/local.xml file).

Define your dev-environment:

Default environment

Create a new Magento module to define a config. Add a global > limesoda > environments node to your config.xml file.

This was easy! We have our first default environment defined.

Now we can run n98-magerun with the new embedded command.

The output is currently empty, because our environment has no commands defined.

Define commands

Now we extend the previous config and add some n98-magerun commands. You can call every n98-magerun command as batch.

This calls two config settings and a cache flush sequentially.

Using variables

If you look at the previous example you see that we used the same url two times. Let’s create a varible for that and see how simple is is to use a variable.

Run n98-magerun again and you should see that output:

Nesting environments

This was very cool, but nesting the environments is really hot!
Let’s do it.
You can do it by adding the attribut parent to your environment definition in XML.

A typical setup could be:

Now we define this setup in our config:

The command processes your configs recursivly. That’s the power of the LimeSode Environment Configuration module.

If you like this way to manage your environments give the modules a change.
You can fetch the module from github.

https://github.com/LimeSoda/LimeSoda_EnvironmentConfiguration

One Pingback/Trackback