Skip to content

Commit

Permalink
case insensitive loading of the environment property
Browse files Browse the repository at this point in the history
  • Loading branch information
iantmoore committed Aug 16, 2017
1 parent 714181e commit f217ef1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/src/main/scala/org/substeps/config/SubstepsConfigLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ object SubstepsConfigLoader {
}

def environmentConfigFile() = {
System.getProperty("ENVIRONMENT", "localhost") + ".conf"

val envConfigFile =
Option(System.getProperty("ENVIRONMENT")) match {
case None => System.getProperty("environment", "localhost") + ".conf"
case Some(env) => env + ".conf"
}

log.debug("Loading environment config file: " + envConfigFile)
envConfigFile
}

def loadEnvironmentOverrides() = {
Expand Down Expand Up @@ -115,7 +123,7 @@ object SubstepsConfigLoader {
val exeConfigList = masterConfig.getConfigList("org.substeps.executionConfigs").asScala

exeConfigList.map(exeCfg => {

// local exe config blocks should override the base.
val thisExecConfig = exeCfg.withFallback(baseExecutionConfig)

thisExecConfig.resolve(ConfigResolveOptions.defaults().setAllowUnresolved(true)).root()
Expand Down

0 comments on commit f217ef1

Please sign in to comment.