How to replace values in properties file with env var on Openshift Online?

Solution Unverified - Updated -

Issue

I have my DB details stored in a properties files. When I tried to replace them with Openshift environment variables they didn't get replaced. eg:

#Updated at Wed Nov 05 14:59:29 SGT 2014
#Wed Nov 05 14:59:29 SGT 2014
database.driverClassName=com.mysql.jdbc.Driver
database.url=jdbc\:mysql\://$OPENSHIFT_MYSQL_DB_HOST\:$OPENSHIFT_MYSQL_DB_PORT/PIP
database.username=$OPENSHIFT_MYSQL_DB_USERNAME
database.password=$OPENSHIFT_MYSQL_DB_PASSWORD

Environment

Openshift Online

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In