[Yanel-dev] redeploying WARs fully automatically

Michael Wechner michael.wechner at wyona.com
Sun May 23 01:26:31 CEST 2010


Michael Wechner wrote:
> Michael Wechner wrote:
>>
>>>
>>> 4) Use environment variable which is configured under the user the 
>>> webapp-server (e.g. Tomcat) is running or configure it during 
>>> startup of the webapp-server (e.g. Tomcat/bin/catalina.sh)
>
> I will start working on this by trying to check on an environment 
> variable called
>
> YANEL_REALMS_HOME
>
> whereas this would be a directory, e.g.
>
> /home/foo/yanel-realms
>
> which could cotains realms, e.g.
>
> /home/foo/yanel-realms/my-realm1/...
> /home/foo/yanel-realms/my-realm2/...
>
> but also a realms config, e.g.
>
> /home/foo/yanel-realms/realms.xml
>
> WDYT?

btw, the implementation would be rather straightforward:

--- src/core/java/org/wyona/yanel/core/map/RealmManager.java    
(revision 49784)
+++ src/core/java/org/wyona/yanel/core/map/RealmManager.java    (working 
copy)
@@ -83,6 +83,17 @@
      * @return Something like realms.xml
      */
     private File getSetRealmsConfigFile(String 
yanelConfigurationFilename) throws ConfigurationException {
+        java.util.Map<String, String> env = System.getenv();
+        for (String envName : env.keySet()) {
+            if (envName.equals("YANEL_REALMS_HOME")) {
+                File yanelRealmsHome = new File(env.get(envName));
+                if (yanelRealmsHome.isDirectory()) {
+                    log.warn("DEBUG: YANEL_REALMS_HOME: " + 
yanelRealmsHome);
+                    break;
+                }
+            }
+        }
+
         YANEL_CONFIGURATION_FILE = yanelConfigurationFilename;
 
         if 
(RealmManager.class.getClassLoader().getResource(YANEL_CONFIGURATION_FILE) 
== null) {


Cheers

Michi


More information about the Yanel-development mailing list