Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28191

Extend Framework.getProperty to read from environment variable

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Runtime

      Description

      Today Framework.getProperty checks for system properties and Nuxeo static configuration (nuxeo.conf file and its templates).

      Moving to dockerized environment often requires to use of environment variables.

      The idea is to be able to override a Nuxeo property directly like:

        nuxeo:
          image: nuxeo/nuxeo:master
          environment:
            NUXEO_FOO_BAR: baz
      

      Note that env variables are always upper-case limited to [A-Z_] and are immutable from the JVM.

      Also, we want to resolve only the property name that starts with "nuxeo." (NUXEO_) because they will be transferred explicitly by nuxeoctl.sh.

      The Nuxeo property names can be in mixed case, the resolution should be smart enough so that nuxeo.fooBar is translated into NUXEO_FOO_BAR env.

      That being said we should recommend not use mixed case property name anymore.

      The resolution ordering must be clear, should be:
      1. environment variables
      2. System properties
      3. Nuxeo configuration (nuxeo.conf, templates ...)

      On the following case the value Framework.getProperty("nuxeo.fooBar") should return "first":

      $ grep nuxeo.fooBar nuxeo.conf
      nuxeo.fooBar=third 
      
      $ NUXEO_FOO_BAR=first java -Dnuxeo.fooBar=second <nuxeo>
      

      Update this TODO in the docker README.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bdelbosc Benoit Delbosc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: