I started working with an existing Grails project and this is the part of the config file (Config.groovy) that deals with external configuration files:
grails.config.locations = [];
def defaultConfigFile = "${basedir}/configs/BombayConfig.groovy"
def defaultDatasourceFile = "${basedir}/configs/BombayDataSource.groovy"
if(File.separator == "\\") {
defaultConfigFile = defaultConfigFile.replace('/', '\\')
defaultDatasourceFile = defaultDatasourceFile.replace('/', '\\')
}
String PROJECT_NAME = "BOMBAY"
String CONFIG_ENV = "${PROJECT_NAME}_CONFIG_LOCATION"
String DATASOURCE_ENV = "${PROJECT_NAME}_DATASOURCE_LOCATION"
def externalConfig = System.getenv(CONFIG_ENV)
def externalDataSource = System.getenv(DATASOURCE_ENV)
if (externalConfig && new File(externalConfig).isFile()) {
grails.config.locations << "file:" + externalConfig
}
else {
grails.config.locations << "file:" + defaultConfigFile
}
if (externalDataSource && new File(externalDataSource).isFile()) {
grails.config.locations << "file:" + externalDataSource
}
else {
grails.config.locations << "file:" + defaultDatasourceFile
}
I have some default files in configs folder, but in the server the files that are being used reside in:
/home/someusername/configuration/
which doesn't look like the default path, and there are no environment variables pointing to that path as the configuration suggests.
I also tried to look for a configs folder linked to the other configuration folder, but didn't find anything.
I'm lost here; how else can configuration files be specified to Grails?
Edit: To clarify on things, the server is running and works, I just want to figure out how it's picking up the configuration files from the above specified path.