Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

Referencing environment variables with include statements in HOCON bootstrap file

Referencing environment variables with include statements in HOCON bootstrap file

Expert Contributor

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}"

 

 

 

2 REPLIES 2

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

Contributor

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

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

Expert Contributor

Thank you for the response.