2017 © Pedro Peláez
 

library environment-parameters

Composer script building your detached parameters for deploying the app. Built above the great incenteev/composer-parameter-handler library.

image

rozehnal/environment-parameters

Composer script building your detached parameters for deploying the app. Built above the great incenteev/composer-parameter-handler library.

  • Friday, March 17, 2017
  • by rozehnal
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2,909 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Composer script building your detached parameters for deploying your app

This tool allows you to manage app parameters for deployment in separate repositories. The repo is fully compatible with all parameters from https://github.com/Incenteev/ParameterHandler., (*1)

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight Latest Unstable Version Latest Stable Version, (*2)

Run

composer run-script build --no-interaction -- --env=prod, (*3)

Usage

Add the following in your root composer.json file:, (*4)

{
    "require": {
        "rozehnal/environment-parameters": "0.x-dev"
    },
    "scripts": {
       "build": [
             "Paro\\EnvironmentParameters\\ParametersHandler::buildParameters"
           ]
    },
    "extra": {
        "environment-parameters": {
          "build-folder": "build",
          "files": [
            {
              "file": "{env}/key.{env}.p12",
              "name": "key.p12"
            }
          ],
          "incenteev-parameters": {
            "file": "parameters.yml",
            "env-map": {
              "path": "PATH"
            }
          }
        }
      }
}

The build/parameters.yml will then be created composer script, to match the structure of the dist file parameters.yml by asking you the missing parameters., (*5)

Supported syntax

  • Fully compatible with https://github.com/Incenteev/ParameterHandler
  • "%env(ENV_VARIABLE)%" syntax in *.yml files
  • imports in *.yml files
 imports:
     - { resource: 'include.yml' }

Hierarchical structure

{
    "extra": {
        "environment-parameters": {
          "files": [
            {
              "file": "{env}/key.p12",
              "name": "key.p12"
            }
          ],
          "incenteev-parameters": {
            "file": "{env}/parameters.yml"
          }
        }
    }
}

composer run-script build --no-interaction -- --env=test/test01, (*6)

Files are searched in order test/test01/key.p12, test/key.p12 and test/test01/parameters.yml, test/parameters.yml. It means you are able to build configuration on inheritence from parent folders with overriding details in children folders. Applicable for both - files and *.yml files., (*7)

Output formats [yaml, php-constants]

Default output format is well-knownyaml file. Currently there is possible to create php file where each parameter defines constant - define(key, value)., (*8)

{
    "extra": {
        "environment-parameters": {
          "incenteev-parameters": {
            "file": "{env}/parameters.yml",
            "name": "parameters.php",
            "output-format": "php-constants"
          }
        }
    }
}

Example

https://github.com/rozehnal/environment-parameters-test, (*9)

Todo

The Versions

17/03 2017

dev-master

9999999-dev https://github.com/rozehnal/environment-parameters

Composer script building your detached parameters for deploying the app. Built above the great incenteev/composer-parameter-handler library.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pavel Rozehnal

configuration parameters management environment management

07/03 2017

v0.8

0.8.0.0 https://github.com/rozehnal/environment-parameters

Composer script building your detached parameters for deploying the app. Built above the great incenteev/composer-parameter-handler library.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pavel Rozehnal

configuration parameters management environment management