[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Environment variables replacement.



This template illustrates it:
https://github.com/jboss-openshift/application-templates/blob/master/webserver/jws30-tomcat7-mysql-persistent-s2i.json

Specifically this section defines the env variables that will be used to define the datasource:
https://github.com/jboss-openshift/application-templates/blob/master/webserver/jws30-tomcat7-mysql-persistent-s2i.json#L454-L485

That should result in a datasource named ${APPLICATION_NAME}-mysql being constructed using the various DB_XXX env variable content, where "DB" comes from the "=DB" portion of the DB_SERVICE_PREFIX_MAPPING.

Kevin, is this behavior documented somewhere?  I didn't see it in the openshift image docs.



On Tue, Feb 9, 2016 at 10:55 AM, andresmbox yahoo es <andresmbox yahoo es> wrote:
Hi,

In Openshift2, you could reference a MySQL DB from a Tomcat cartridge just defining some environment variables, that were replaced automatically in the JNDI definition at the context.xml.
<Resource name="jdbc/piadmin"
url="">${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME}"
driverClassName="com.mysql.jdbc.Driver"
username="${OPENSHIFT_MYSQL_DB_USERNAME}"
password="${OPENSHIFT_MYSQL_DB_PASSWORD}"
auth="Container"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="5"
maxWait="10000"
/>
In OpenShift3, this doesnt work. The tokens in context.xml are not replaced by their corresponding environment variable values. What is then the correct way to connect a JNDI datasource in a Tomcat S2I like jboss-webserver30-tomcat7-openshift?

Thanks,

Andrés.

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




--
Ben Parees | OpenShift


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]