How to use environment variable in nuxeo.conf?
Hi,
I am trying to use a environment variable in nuxeo.conf. I am using Ubuntu 14.04.1 LTS.
I installed Nuxeo through apt-get from the Nuxeo repository.
I added “DBHOST=localhost” to “/etc/environment” then sourced the file.
When I do “echo $DBHOST” I get the output “localhost”.
Then I changed the db.host line in nuxeo.conf to “nuxeo.db.host=${DBHOST}” but when I start the server it fails because it cannot connect to the database.
It works fine if I do “nuxeo.db.host=localhost”.
Unfortunately there is no support in nuxeo.conf
to read environment variables.
What you could do is change nuxeoctl
to upate/rewrite nuxeo.conf
with your environment variable before the normal startup.
It is possible to keep some "dynamic" aspect on some parameters by giving them a variable as value: for instance, nuxeo.db.host=${custom.nuxeo.db.host} Then, you can use the produced Nuxeo WAR in an environment where custom.nuxeo.db.host is defined from outside."
From http://doc.nuxeo.com/pages/viewpage.action?pageId=3866689 "Those parameters can be either environment parameters used by Nuxeo runtime or template parameters used for values replacement in configuration files."
Is this correct? Can you elborate?