I’m trying to deploy a Grails application on Openshift.
I’m deploying the app using a locally built war file.
Right now, I am using the url given by the rhc-app-show command in the DataSource.groovy file for my Database configurations.
Whenever I try with the environment variables of Openshift (eg. $OPENSHIFT_MYSQL_DB_HOST), it crashes. Any idea or pointers on how to use those in the config file?
Thanks.
I haven’t used OpenShift but Google led me to the FAQ which shows these environment variables:
so it looks like this would work:
The missing bit is the database name – is that something that you would have available? I’m not sure of the format of
OPENSHIFT_MYSQL_DB_URLbut it looks like you might just be able to useurl = "jdbc:${System.getenv('OPENSHIFT_MYSQL_DB_URL')}"