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

Re: Using Environment Variables within context.xml - Tomcat 8 Source 2 Image



David,

Try adding `env.` to your variables (e.g. `${env.MAPPING_JNDI}`) [0].  You can also verify that the vars are set the way you expect using `oc rsh ...` or `oc debug ...` (in the case of a failed pod).

[0] https://access.redhat.com/solutions/3190862

___________________________________________________

LOUIS P. SANTILLAN

Architect, OPENSHIFT, MIDDLEWARE & DEVOPS

Red Hat Consulting, Container and PaaS Practice

lsantill redhat com   M: 3236334854    




On Wed, Jan 17, 2018 at 2:23 AM, David Gibson <dgibson9999 yahoo co uk> wrote:
Hello,

I was wondering if it is possible to achieve the following:

We have created a Geoserver web app using the Tomcat 8 source to image file, however we require this app to connect to 3 external databases to retrieve the spatial data.

To build our application we are using the Jenkins S2I and have created a build pipeline that will build, deploy and promote the application through various stages eg dev, test, prod.

Using the Tomcat Source 2 Image the app has been created and the war file gets deployed along with the context.xml file specific for the application, which if we hardcode all the values in the context.xml file this will work for an individual environment.

I have read that it was possible in OS version 2 to substitute the values in the context.xml file with environment variable within OS however this does not seem to work.

What we have is

context xml

<Resource name="${MAPPING_JNDI}"
                     url = "">

etc.

<Resource name = "${OSMAP_JNDI}"
                     url = "">

In the deploy template we have these values configured as environment variable as such

- name: "MAPPING_JNDI"
  value: ${MAPPING_JNDI}

where the values are read in from a properties file.

If I use the terminal to inspect the pod I can see that the environment variable are all set correctly, however the JNDI lookup fails as the values have not been substituted. Is it possible to do this.

Thanks,

David


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



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