Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow properties from the .properties file to be set via environment variables. #20

Open
digitalfiz opened this issue Jun 7, 2017 · 6 comments

Comments

@digitalfiz
Copy link

Having to generate this properties file for each environment is not at all 12 factor app. It would be nice if setting STREAM_NAME and others via environment variables overrode properties file values. Kind of like auth works for the sdk.

@jqr
Copy link

jqr commented Jun 7, 2017

Yeah I ended up making a script to generate the properties file dynamically using a template so we could have 4 apps all use the same one. I don't have access to that code any more but IIRC you could have it read from STDIN instead of writing to the filesystem.

@lancedikson
Copy link

Agree. I'm even overwhelmed with the fact that it doesn't take those properties as env variables.

@Cory-Bradshaw
Copy link
Contributor

Thank you for reporting this feature request. If you or other customers can leave more details on how this impacts your workflows and +1 this issue to help us plan and prioritize this work.

@akshaypinto
Copy link

+1

1 similar comment
@skcc321
Copy link

skcc321 commented Apr 5, 2021

+1

@cbatson
Copy link

cbatson commented Jun 21, 2021

You can use ERB to achieve this. Example:

properties_body = ERB.new(IO.read(Rails.root.join('config/consumer.properties.erb'))).result
properties_file = Rails.root.join('tmp/consumer.properties')
IO.write(properties_file, properties_body)

Then in the consumer.properties.erb file

streamName = <%= ENV['KCL_STREAM_NAME'] %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants