Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Showing 4 changed files with 21 additions and 15 deletions.
12 changes: 11 additions & 1 deletion src/main/java/com/marklogic/appdeployer/AppConfig.java
Original file line number Diff line number Diff line change
@@ -102,7 +102,9 @@ public class AppConfig {
// Comma-delimited string used for configuring forest replicas
private String databaseNamesAndReplicaCounts;


// Path to use for DeployFlexrepCommand
private String flexrepPath;

public AppConfig() {
this(DEFAULT_MODULES_PATH, DEFAULT_SCHEMAS_PATH);
}
@@ -489,4 +491,12 @@ public FileFilter getAssetFileFilter() {
public void setAssetFileFilter(FileFilter assetFileFilter) {
this.assetFileFilter = assetFileFilter;
}

public String getFlexrepPath() {
return flexrepPath;
}

public void setFlexrepPath(String flexrepPath) {
this.flexrepPath = flexrepPath;
}
}
Original file line number Diff line number Diff line change
@@ -107,6 +107,11 @@ public AppConfig newAppConfig() {
c.setDatabaseNamesAndReplicaCounts(prop);
}

prop = getProperty("mlFlexrepPath");
if (prop != null) {
logger.info("Flexrep path: " + prop);
c.setFlexrepPath(prop);
}
return c;
}

Original file line number Diff line number Diff line change
@@ -21,14 +21,7 @@
*/
public class DeployFlexrepCommand extends AbstractCommand implements UndoableCommand {

private String path;

public DeployFlexrepCommand() {
this("master");
}

public DeployFlexrepCommand(String path) {
this.path = path;
setExecuteSortOrder(SortOrderConstants.DEPLOY_OTHER_SERVERS);
}

@@ -72,6 +65,7 @@ public void undo(CommandContext context) {
}

protected File getFlexrepBaseDir(AppConfig appConfig) {
String path = appConfig.getFlexrepPath();
if (path == null) {
return null;
}
@@ -88,9 +82,4 @@ protected File getFlexrepBaseDir(AppConfig appConfig) {

return flexrepBaseDir;
}

public void setPath(String path) {
this.path = path;
}

}
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@ public void noFlexrepDir() {
public void masterFlexrep() {
appConfig.getConfigDir().setBaseDir(new File("src/test/resources/sample-app/flexrep-combined"));

initializeAppDeployer(new DeployContentDatabasesCommand(1), new DeployTriggersDatabaseCommand(), new DeployFlexrepCommand("master"));
appConfig.setFlexrepPath("master");
initializeAppDeployer(new DeployContentDatabasesCommand(1), new DeployTriggersDatabaseCommand(), new DeployFlexrepCommand());

appDeployer.deploy(appConfig);

@@ -82,7 +83,8 @@ public void masterFlexrep() {
public void replicaFlexrep() {
appConfig.getConfigDir().setBaseDir(new File("src/test/resources/sample-app/flexrep-combined"));

initializeAppDeployer(new DeployContentDatabasesCommand(1), new DeployTriggersDatabaseCommand(), new DeployFlexrepCommand("replica"));
appConfig.setFlexrepPath("replica");
initializeAppDeployer(new DeployContentDatabasesCommand(1), new DeployTriggersDatabaseCommand(), new DeployFlexrepCommand());

appDeployer.deploy(appConfig);

0 comments on commit f303c57

Please sign in to comment.