question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Env specific settings override mechanisms

See original GitHub issue

Lagom services may need specific settings depending on the environment (test, dev, prod).

It may be useful to introduce production.conf and development.conf that override application.confonly on the mentioned environment.

E.g. using the DevMode Cassandra server during development but production environment needs specific tuning to use an externally provided Cassandra. In that case, most settings would be in application.conf but Production env needs SessionProvider override and contact-points.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
jropercommented, May 8, 2017

While yes it’s simple to achieve:

a) We don’t have instructions for the above - for example, where do you add the -Dconfig.resource argument? b) Lagom is by design a lot more opinionated than Play, and this is possibly one place where that opinionatedness should show - we should have a supported, consistent way of providing different configurations in different environments.

1reaction
guizmaiicommented, Jun 12, 2017

Hi

Just for information, here is how we achieve this in our Play apps but also in our Lagom app until now, in the build.sbt:

// Debug helper
bashScriptExtraDefines += """echo "ENV = ${ENV}""""

bashScriptExtraDefines += """addJava "-Dconfig.resource=${ENV}.conf""""
bashScriptExtraDefines += """addJava "-Dnewrelic.environment=${ENV}""""

It works well but I think that to give an “official” solution to achieve that will help beginners !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overriding Web.config Settings with Environment Variables in ...
Create a script (Set-WebConfigSettings.ps1) that reads environment variables and overrides configuration in Web.config by modifying the file ...
Read more >
Env Var Overrides - CFConfig Documentation
Every Config Setting can be overridden by convention by creating environment variables in the shell where you run box . This is ideal...
Read more >
Config override | Drupal.org
Override mechanisms Currently there are two override mechanisms: A site wide override folder ... Environment variables providing overrides, see.
Read more >
Environment variables and app settings in Azure App Service
To override the default validation value, configure it as an App Service app setting, or set it directly in the machineKey element of...
Read more >
Specify environment-specific configuration values for an application
When configuration is merged in memory, the system can override values with ones that apply in specific contexts. This section illustrates how the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found