aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src/main/java/org
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-03-08 18:45:24 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-03-21 16:44:03 +0100
commit4d3d6b2504673128263eadcec82c8fd64f71e4c5 (patch)
tree037a32442fc3f898cb36447e703de6d45a741a75 /sonar-application/src/main/java/org
parent37c03b26859c6ad3b56442b7f5a0e039526f5eb5 (diff)
downloadsonarqube-4d3d6b2504673128263eadcec82c8fd64f71e4c5.tar.gz
sonarqube-4d3d6b2504673128263eadcec82c8fd64f71e4c5.zip
SONAR-7435 add CE process, never stops but does nothing yet
Diffstat (limited to 'sonar-application/src/main/java/org')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java67
1 files changed, 46 insertions, 21 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java
index ca2f98d62b8..1537405fa04 100644
--- a/sonar-application/src/main/java/org/sonar/application/App.java
+++ b/sonar-application/src/main/java/org/sonar/application/App.java
@@ -53,8 +53,20 @@ public class App implements Stoppable {
}
private static List<JavaCommand> createCommands(Props props) {
- List<JavaCommand> commands = new ArrayList<>();
File homeDir = props.nonNullValueAsFile(ProcessProperties.PATH_HOME);
+ List<JavaCommand> commands = new ArrayList<>(3);
+ commands.add(createESCommand(props, homeDir));
+
+ // do not yet start WebServer nor CE on elasticsearch slaves
+ if (StringUtils.isBlank(props.value(ProcessProperties.CLUSTER_MASTER_HOST))) {
+ commands.add(createWebServerCommand(props, homeDir));
+ commands.add(createCeServerCommand(props, homeDir));
+ }
+
+ return commands;
+ }
+
+ private static JavaCommand createESCommand(Props props, File homeDir) {
JavaCommand elasticsearch = new JavaCommand("search");
elasticsearch
.setWorkDir(homeDir)
@@ -65,28 +77,41 @@ public class App implements Stoppable {
.setArguments(props.rawProperties())
.addClasspath("./lib/common/*")
.addClasspath("./lib/search/*");
- commands.add(elasticsearch);
+ return elasticsearch;
+ }
- // do not yet start SQ on elasticsearch slaves
- if (StringUtils.isBlank(props.value(ProcessProperties.CLUSTER_MASTER_HOST))) {
- JavaCommand webServer = new JavaCommand("web")
- .setWorkDir(homeDir)
- .addJavaOptions(ProcessProperties.WEB_ENFORCED_JVM_ARGS)
- .addJavaOptions(props.nonNullValue(ProcessProperties.WEB_JAVA_OPTS))
- .addJavaOptions(props.nonNullValue(ProcessProperties.WEB_JAVA_ADDITIONAL_OPTS))
- // required for logback tomcat valve
- .setEnvVariable(ProcessProperties.PATH_LOGS, props.nonNullValue(ProcessProperties.PATH_LOGS))
- .setClassName("org.sonar.server.app.WebServer")
- .setArguments(props.rawProperties())
- .addClasspath("./lib/common/*")
- .addClasspath("./lib/server/*");
- String driverPath = props.value(ProcessProperties.JDBC_DRIVER_PATH);
- if (driverPath != null) {
- webServer.addClasspath(driverPath);
- }
- commands.add(webServer);
+ private static JavaCommand createWebServerCommand(Props props, File homeDir) {
+ JavaCommand webServer = new JavaCommand("web")
+ .setWorkDir(homeDir)
+ .addJavaOptions(ProcessProperties.WEB_ENFORCED_JVM_ARGS)
+ .addJavaOptions(props.nonNullValue(ProcessProperties.WEB_JAVA_OPTS))
+ .addJavaOptions(props.nonNullValue(ProcessProperties.WEB_JAVA_ADDITIONAL_OPTS))
+ // required for logback tomcat valve
+ .setEnvVariable(ProcessProperties.PATH_LOGS, props.nonNullValue(ProcessProperties.PATH_LOGS))
+ .setClassName("org.sonar.server.app.WebServer")
+ .setArguments(props.rawProperties())
+ .addClasspath("./lib/common/*")
+ .addClasspath("./lib/server/*");
+ String driverPath = props.value(ProcessProperties.JDBC_DRIVER_PATH);
+ if (driverPath != null) {
+ webServer.addClasspath(driverPath);
}
- return commands;
+ return webServer;
+ }
+
+ private static JavaCommand createCeServerCommand(Props props, File homeDir) {
+ JavaCommand webServer = new JavaCommand("ce")
+ .setWorkDir(homeDir)
+ .setClassName("org.sonar.ce.app.CeServer")
+ .setArguments(props.rawProperties())
+ .addClasspath("./lib/common/*")
+ .addClasspath("./lib/server/*")
+ .addClasspath("./lib/ce/*");
+ String driverPath = props.value(ProcessProperties.JDBC_DRIVER_PATH);
+ if (driverPath != null) {
+ webServer.addClasspath(driverPath);
+ }
+ return webServer;
}
static String starPath(File homeDir, String relativePath) {