Open digitalfiz opened 7 years ago
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.
Agree. I'm even overwhelmed with the fact that it doesn't take those properties as env variables.
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.
+1
+1
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'] %>
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.