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.
POSTGRES SQL ALSO ...there is a nice , tutorial for that on this link ...but the datasource configuration must be configured like this ....
second Alternative . . .
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_URL
but it looks like you might just be able to useurl = "jdbc:${System.getenv('OPENSHIFT_MYSQL_DB_URL')}"
In Grails 3.0.11, File application.yml
System.getenv doesn't work, so i had to configure manually the url connection for database in mysql.... Use the command of documentation https://developers.openshift.com/en/managing-port-forwarding.html