Jump to content

Calling all Java Developers / Release Engineers.


Spartan

Recommended Posts

evarevar unnaro teliyadu..but some questions reg depliying J2EE applications.

@innovative i think 

ippudu oka EAR/WAR file undi. we generate that using Jenkins in CICD process.

i would like to have environment based connectors in different files and deploy accordingly.

like Development Env k okati

Staging ki okati

Prod ki okati..each of them have different endpoints for ear services/db/ etc...

so avanni which file will control, and when deploying how to specify to use that particular descriptor.

App Server: JBOSS,  WebServer : Tomcat. 

using Maven. 

@k2s  @tom bhayya 

PS: Nenu Java ki kotta...dont have any exp in it.. qn dumb aiyte kshaminchandi, tappaite manninchandi.  Monday Interview ki preparing. 

 

thanks everyone. 

 

found one link..

https://www.javaworld.com/article/2073030/java-app-dev/organize-applications--multiple-environment-configurations.html

Link to comment
Share on other sites

.net applicaitons lo connnectionstrings etc untai, we can create config files seperately for the web config to use appropriate ones.

 

ala J2EE app lo em untadi. 

Link to comment
Share on other sites

ma degerra ela ante..jenkins tho tar file generate chestharu ... in that tar file   we have a war file and different config folder's for diff env...    once that tar is unzipped on the box (we use jetty server) ... it is deployed using a script file.. this script file point to the right config folder based on the env

Link to comment
Share on other sites

10 minutes ago, Gains said:

ma degerra ela ante..jenkins tho tar file generate chestharu ... in that tar file   we have a war file and different config folder's for diff env...    once that tar is unzipped on the box (we use jetty server) ... it is deployed using a script file.. this script file point to the right config folder based on the env

but ear or war lo once zipped, when dpeloying on JBOSS, we shouldnt explode the folders kada..

correct me if i am wrong.

Link to comment
Share on other sites

8 minutes ago, Spartan said:

but ear or war lo once zipped, when dpeloying on JBOSS, we shouldnt explode the folders kada..

correct me if i am wrong.

i mean tar file unzip chestham ..which has war file  + config folders ... we wont explode war file

  • Upvote 1
Link to comment
Share on other sites

25 minutes ago, Gains said:

i mean tar file unzip chestham ..which has war file  + config folders ... we wont explode war file

cool, new point learned. 

Link to comment
Share on other sites

1 minute ago, Gains said:

i mean tar file unzip chestham ..which has war file  + config folders ... we wont explode war file

There are multiple ways you could do it but needs some kind of scripting. The above process of tar file makes sense too. 1)checkin config file as confi-dev,config-qa etc. Write a script to unzip the war, rename the config file to config.properties(the file app looks for), then rezip the war file then deploy. Make sure the war file is not corrupted when rezipped. 

2) Check in config files in version control and setup script to update when you deploy. 

3) If using puppet or chef the 2nd option could be used. Just replace custom script with puppet of chef scripts

4)Assuming all config files are inside war, create a environment variable on you app server matching config file name and location. Use the environment varible inside the java code to get the config file location

 

Link to comment
Share on other sites

7 minutes ago, cnugadu said:

There are multiple ways you could do it but needs some kind of scripting. The above process of tar file makes sense too. 1)checkin config file as confi-dev,config-qa etc. Write a script to unzip the war, rename the config file to config.properties(the file app looks for), then rezip the war file then deploy. Make sure the war file is not corrupted when rezipped. 

2) Check in config files in version control and setup script to update when you deploy. 

3) If using puppet or chef the 2nd option could be used. Just replace custom script with puppet of chef scripts

4)Assuming all config files are inside war, create a environment variable on you app server matching config file name and location. Use the environment varible inside the java code to get the config file location

 

#3 best option in my view

Link to comment
Share on other sites

The apps have 2 parts , one is code which is developer managed and checked into git and built as war file and deployed.2nd is env config/server config owned by infrastructure team, this will have db passwords etc..these stick to machine and manually managed.if u want to automate this, these are pushed by chef/puppet and the same chef assigns a jvm parameter which says if its qa or prod.so jvm picks right config file

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...