Reply
Explorer
Posts: 20
Registered: ‎10-02-2017

Referencing environment variables with include statements in HOCON bootstrap file

Hi.

 

We use Jenkins to kick off bootstrap of CDH clusters using Cloudera Director client.  At the top of our bootstrap config, we use an include to pull in customer specific parameters.  Jenkins sets an environment variable for customerid and we'd like to reference this variable within the include statement.   I've seen a handful of references online, but none have worked.  Suggestions?

 

Works:

include "customer-config/customer18/customer-env.properties" 

 

Big fail:

include "file://${CUSTENVPATH}" 

include "${CUSTENVPATH}"

 

 

 

Cloudera Employee
Posts: 13
Registered: ‎08-24-2015

Re: Referencing environment variables with include statements in HOCON bootstrap file

[ Edited ]

Unfortuantly, this is a known limitation of Hocon, see https://github.com/lightbend/config/issues/122. Glancing at the comments, it doesn't look like there are any workarounds to get this type of substitution working.

Highlighted
Explorer
Posts: 20
Registered: ‎10-02-2017

Re: Referencing environment variables with include statements in HOCON bootstrap file

Thank you for the response. 

Announcements