-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enabling context variable to define dhis2_home #6573
feat: Enabling context variable to define dhis2_home #6573
Conversation
...s-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java
Outdated
Show resolved
Hide resolved
…sp/dhis/external/location/DefaultLocationManager.java
Dear @stian-sandvold , Is there any issue with that PR, If yes can I help ? Thanks in advance br |
Thanks @delcroip for the patch. Just checking, is there any change in existing behavior here, i.e. would the system still read the DHIS 2 environment variable and system property as before? Which order/priority has the context variable? |
Hello @larshelge The reason is that in many case the Env variable is used to configure DHIS2; The goal of this change it to have several dhis2 on the same tomcat, so the context variable, when set, should have a priority in order to not mess with the existing DHIS2 install (if any) best regards |
SonarCloud Quality Gate failed. |
Hello @larshelge , I tried to solve a merge issue but it seems I don't respect some rules, the message from sonarcloud is not clear, can you tell me what I did wrong ? (I didn't change anything but add your import which was creating the conflict) |
Hey delcroip, sorry for the slow response. I had another look at your PR, and have some feedback:
To me, I'm happy with merging this as long as you fix item 2. If you have ideas to reduce complexity they are also welcome. |
@stian-sandvold I tested (during maven build) with default, system var and Env var, I didn't retest the contex variable because I couldn't with maven, but I will do it a bit later Also, I hope it is ok to piggyback a change in the json test to remove an error that block me every time I build on windows |
@stian-sandvold is there an issue ? |
Hey @delcroip , so sorry about the delay; It completely slipped my mind. I had some test issues locally, but they seem unrelated, so I decided to create a new branch within the repo so we can run the automatic checks. I'll merge your PR into that branch, and I'll reach out if there are any issues :) |
* feat: Enabling context variable to define dhis2_home (#6573) * add DHIS2_HOME in context * correct log message * remove dot on context var * Update dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java * reduce code complexity * remove error while building on windows (EOF related) Co-authored-by: Stian Sandvold <stian@dhis2.org> Co-authored-by: Patrick Delcroix <pmpdelcroix@gmail.com> * style: Fix code style issues Co-authored-by: Patrick Delcroix <delcroip@gmail.com> Co-authored-by: Patrick Delcroix <pmpdelcroix@gmail.com>
To be able to set the dhis2 home from a context var instead of system property so one can have multiple DHIS2 running without messing the env variable (and running multiple tomcat)
Solution inspired from https://stackoverflow.com/questions/372686/how-can-i-specify-system-properties-in-tomcat-configuration-on-startup
Example of context file to put on TOMCAT_HOME/conf/Catalina/localhost/[warname].xml when using Catalina engine and no specific host configured
I tested the solution, DHIS2 detect the right value