magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 154 forks source link

instance configuration after deployment #177

Closed flancer64 closed 9 years ago

flancer64 commented 9 years ago

Hello, guys.

This is not an issue itself I need an advice. I have a Magento project that is deployed with Magento Composer. We have 4 instances for each project:

Also we have shell scripts to clone DBs (from test to development, and from production to pilot).

Each instance has its own connection parameters to DB (in app/etc/local.xml) and own parameters to connect to other host to clone DBs.

Let's say that I have a common template for local.xml with placeholders for db name, user and password and common template for scripts to clone DBs with other placeholders (IP address, etc) in my project. All these templates are under version control. Also I have instance specific configuration file with values to replace placeholders in templates (this file is not under version control).

What is the preferred way to generate instance specific files from universal templates using Magento Composer?

I am going to create shell scripts to generate locally specific files from templates on

{
  "scripts": {
    "post-install-cmd": [
      "./setup.sh"
    ]
  }
}

May be there is a better way?

Thanks,

Alex.

Flyingmana commented 9 years ago

We have no feature covering this usecase yet, and build processes are very different from company to company.

The only thing I know in this context is https://github.com/LimeSoda/LimeSoda_EnvironmentConfiguration but I have never worked with it.

I hope this helps. (I let this Issue open, as I think we need some Documentation mentioning this usecase)

flancer64 commented 9 years ago

Thanks, Flyingmana.

This is very interesting module. We preform some configuration tasks inside the DB cloning process (replace "unsecure_base_url" value, for example) using instance specific SQL-scripts. Perhaps LimeSoda_EnvironmentConfiguration can do it better.

davidverholen commented 9 years ago

we use a custom composer plugin, that deploys different versions of the local.xml. I also thought about a function in the installer, that lets you overwrite local.xml configs from the composer config

flancer64 commented 9 years ago

I have created composer plugin to create configuration files from common templates and file with instance specific variables - https://github.com/praxigento/composer_plugin_templates

This plugin has solved my configuration problem.