rsijaya
rsijaya

Reputation: 169

Grails External configuration Config System.getenv

i have code in config.groovy

def ENV_NAME = "/home/myFolder"

if(System.getenv("ENV_NAME")) {
    println( "Including configuration file: " + System.getenv("ENV_NAME"));
    grails.config.locations << "file:" + System.getenv("ENV_NAME")
} else {
    println "No external configuration file defined."
}

When I run, the result is "No external configuration file defined." What do I miss?

Upvotes: 2

Views: 2564

Answers (1)

Ian Roberts
Ian Roberts

Reputation: 122364

Presumably that there isn't an environment variable named ENV_NAME defined at the point when you ran the app.

Upvotes: 1

Related Questions