. appserver.properties was missing in last commit

. 1st changes for a remote deployment tool
. better README file

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@647299 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2008-04-11 20:19:07 +00:00
parent f1e0a5365e
commit cf1bcbd3d8
4 changed files with 91 additions and 32 deletions
@@ -121,21 +121,23 @@ public class GenerateContainer implements Container {
String user = UtilProperties.getPropertyValue("appserver", "user", "system");
String password = UtilProperties.getPropertyValue("appserver", "password", "manager");
boolean offline = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "offline", "true");
boolean pauseInGeronimoScript = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "pauseInGeronimoScript", "true");
int instancesNumber = (int) UtilProperties.getPropertyNumber("appserver", "instancesNumber");
boolean offline = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "offline", "true");
String host = UtilProperties.getPropertyValue("appserver", "host", "");
String port = UtilProperties.getPropertyValue("appserver", "port", "");
boolean pauseInGeronimoScript = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "pauseInGeronimoScript", "true");
String instanceNumber = "";
if (isGeronimo) {
if (geronimoHome == null) {
geronimoHome = System.getenv("GERONIMO_HOME");
if (geronimoHome == null) {
Debug.logFatal("'GERONIMO_HOME' was not found in your environment. Please set the location of Geronimo into a GERONIMO_HOME env var or pass it as geronimoHome property in setup.properties file.", module);
Debug.logFatal("'GERONIMO_HOME' was not found in your environment. Please set the location of Geronimo into a GERONIMO_HOME env var or as a geronimoHome property in setup.properties file.", module);
throw new ContainerException("Error in Geronimo deployment, please check the log");
}
File geronimoHomeDir = new File (geronimoHome);
if (! (geronimoHomeDir.isDirectory())) {
Debug.logFatal(geronimoHome + " does not exist or is not a directoy. Please set the location of Geronimo into a GERONIMO_HOME env var or pass it as geronimoHome property in setup.properties file.", module);
Debug.logFatal(geronimoHome + " does not exist or is not a directoy. Please set the location of Geronimo into a GERONIMO_HOME env var or as a geronimoHome property in setup.properties file.", module);
throw new ContainerException("Error in Geronimo deployment, please check the log");
}
}
@@ -227,19 +229,26 @@ public class GenerateContainer implements Container {
File workingDir = new File(geronimoBin);
ProcessBuilder pb = null;
String command = null;
String commandCommonPart = null;
String commandCommonHostPart = "";
if (UtilValidate.isNotEmpty(host)) {
commandCommonHostPart = " --host" + host + (UtilValidate.isNotEmpty(port) ? port : "");
}
if ("\\".equals(separator)) { //Windows
commandCommonPart = "deploy --user " + user + " --password " + password + commandCommonHostPart;
if (offline) {
command = "deploy --user " + user + " --password " + password + " --offline undeploy " + ofbizName;
command = commandCommonPart + " --offline undeploy " + ofbizName;
} else {
command = "deploy --user " + user + " --password " + password + " undeploy " + ofbizName;
command = commandCommonPart + " undeploy " + ofbizName;
}
pb = new ProcessBuilder("cmd.exe", "/c", command);
} else { // Linux
commandCommonPart = workingDir + "/deploy.sh --user " + user + " --password " + password + commandCommonHostPart;
if (offline) {
command = workingDir + "/deploy.sh --user " + user + " --password " + password + " --offline undeploy " + ofbizName;
command = commandCommonPart + " --offline undeploy " + ofbizName;
} else {
command = workingDir + "/deploy.sh --user " + user + " --password " + password + " undeploy " + ofbizName;
command = commandCommonPart + " undeploy " + ofbizName;
}
pb = new ProcessBuilder("sh", "-c", command);
}
@@ -43,7 +43,7 @@ import org.ofbiz.base.util.UtilURL;
import org.ofbiz.base.util.template.FreeMarkerWorker;
/**
* GenerateGeronimoRepository - Generate needed 3d parties jars (only? rather all jars for now, see commented lines below) in Geronimo (or WASCE) repository
* GenerateGeronimoRepository - Generate needed jars in Geronimo (or WASCE) repository
*
*/
public class GenerateGeronimoDeployment {