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

2018-01-18 Thread Louis Santillan
Which base image are you using?

___

LOUIS P. SANTILLAN

Architect, OPENSHIFT, MIDDLEWARE & DEVOPS

Red Hat Consulting,  Container and PaaS Practice

lsant...@redhat.com   M: 3236334854

TRIED. TESTED. TRUSTED. 



On Thu, Jan 18, 2018 at 12:41 AM, David Gibson 
wrote:

> Louis,
>
> Thanks for the response, I have tried prefixing the variables with env.
> but it had the same result. Also checked to make sure the pod had picked up
> the correct environment variable and all variables had been set as expected.
>
> David
>
>
> On Thursday, 18 January 2018, 02:22:24 GMT, Louis Santillan <
> lsant...@redhat.com> wrote:
>
>
> 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
>
> lsant...@redhat.com   M: 3236334854
> 
> TRIED. TESTED. TRUSTED. 
>
>
>
> On Wed, Jan 17, 2018 at 2:23 AM, David Gibson 
> 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
>
>   url = "${MAPPING_URL}"
>
> etc.
>
>   url = "${OSMAP_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
> 
>
>
>
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


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

2018-01-17 Thread Louis Santillan
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

lsant...@redhat.com   M: 3236334854

TRIED. TESTED. TRUSTED. 



On Wed, Jan 17, 2018 at 2:23 AM, David Gibson 
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
>
>   url = "${MAPPING_URL}"
>
> etc.
>
>   url = "${OSMAP_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
>
>
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


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

2018-01-17 Thread David Gibson
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
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users