Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8126

Interpolation of magnolia properties and environment variables into YAML files

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Neutral Neutral
    • None
    • 6.2
    • configuration

      Add the possibility to substitute or interpolate environment/magnolia properties. Specify placeholders in yaml definitions/decorations which will be parsed before loading them, so developers can refer to variables specified in e.g. magnolia.properties or environment variables. Configuration per environment/profile is very common and used in frameworks like spring.

      Use case:
      A rest-client definition has the same yaml definition, but only the baseUrl or a timeout setting is different.

      Example configuration:

      database:
        host: ${DB_HOST:-localhost}
        user: ${DB_USER:-defaultuser}
        password: ${DB_PASSWORD}
      

      The DB_HOST will be replaced using the MagnoliaConfiguration class which will lookup the value from the layers of property sources (magnolia.properties, environment variables, etc..)

      Workaround
      Different configurations possible for different environments

        Acceptance criteria

              Unassigned Unassigned
              rgange Richard Gange
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: