muuki88 / sbt-native-packager-examples

A set of sbt-native-pakager examples
Apache License 2.0
236 stars 55 forks source link

dynamic-mappings loads env from environment, not config file #17

Closed warrenronsiek closed 4 years ago

warrenronsiek commented 4 years ago

The the dynamic mappings example project doesn't actually load the env value from the config files, instead it loads from the environment variable directly. The simplest way to see this to run sbt -Denv=prod run in the terminal and note that the output This package runs in prod is not what would be expected as prod.conf sets env = production and not env = prod.

muuki88 commented 4 years ago

Thanks for the issue @warrenronsiek :smile:

The idea behind this example is not that you can change the application.conf mapping for the resulting package, not during sbt run. These are two very separate things.

This example only changes the mappings in Universal, but nothing inside the run command.

What are you trying to achieve? The example is pretty old and I would rather recommend shipping all configurations and start your application with a different config.resource parameter in different environments.