Skip to content

Commit 236d01b

Browse files
committed
updating build dependencies
1 parent bc85759 commit 236d01b

File tree

6 files changed

+43
-124
lines changed

6 files changed

+43
-124
lines changed

marklogic-data-hub/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'java'
44
id 'maven-publish'
55
id 'com.jfrog.bintray' version '1.7.2'
6-
id 'com.marklogic.ml-gradle' version '2.5.0'
6+
id 'com.marklogic.ml-gradle' version '2.6.0'
77
id 'com.moowork.node' version '1.1.1'
88
}
99

@@ -21,9 +21,9 @@ targetCompatibility = 1.8
2121
dependencies {
2222
compile 'org.springframework.batch:spring-batch-core:3.0.6.RELEASE'
2323
compile 'org.springframework:spring-jdbc:4.2.6.RELEASE'
24-
compile 'com.marklogic:java-client-api:3.0.5'
25-
compile 'com.marklogic:ml-javaclient-util:2.12.1'
26-
compile 'com.marklogic:ml-app-deployer:2.5.0'
24+
compile 'com.marklogic:java-client-api:3.0.7'
25+
compile 'com.marklogic:ml-javaclient-util:2.13.0'
26+
compile 'com.marklogic:ml-app-deployer:2.6.0'
2727
compile 'com.marklogic:marklogic-spring-batch-core:0.7.0'
2828
compile 'commons-io:commons-io:2.4'
2929
testCompile 'org.springframework.batch:spring-batch-test:3.0.6.RELEASE'

marklogic-data-hub/src/main/java/com/marklogic/hub/DataHub.java

Lines changed: 25 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,8 @@
1919
import com.fasterxml.jackson.databind.ObjectMapper;
2020
import com.marklogic.appdeployer.AppConfig;
2121
import com.marklogic.appdeployer.command.Command;
22-
import com.marklogic.appdeployer.command.alert.DeployAlertActionsCommand;
23-
import com.marklogic.appdeployer.command.alert.DeployAlertConfigsCommand;
24-
import com.marklogic.appdeployer.command.alert.DeployAlertRulesCommand;
22+
import com.marklogic.appdeployer.command.CommandMapBuilder;
2523
import com.marklogic.appdeployer.command.appservers.DeployOtherServersCommand;
26-
import com.marklogic.appdeployer.command.cpf.DeployCpfConfigsCommand;
27-
import com.marklogic.appdeployer.command.cpf.DeployDomainsCommand;
28-
import com.marklogic.appdeployer.command.cpf.DeployPipelinesCommand;
29-
import com.marklogic.appdeployer.command.flexrep.DeployConfigsCommand;
30-
import com.marklogic.appdeployer.command.flexrep.DeployFlexrepCommand;
31-
import com.marklogic.appdeployer.command.flexrep.DeployTargetsCommand;
32-
import com.marklogic.appdeployer.command.forests.ConfigureForestReplicasCommand;
33-
import com.marklogic.appdeployer.command.groups.DeployGroupsCommand;
34-
import com.marklogic.appdeployer.command.mimetypes.DeployMimetypesCommand;
35-
import com.marklogic.appdeployer.command.schemas.LoadSchemasCommand;
36-
import com.marklogic.appdeployer.command.security.*;
37-
import com.marklogic.appdeployer.command.tasks.DeployScheduledTasksCommand;
38-
import com.marklogic.appdeployer.command.triggers.DeployTriggersCommand;
39-
import com.marklogic.appdeployer.command.viewschemas.DeployViewSchemasCommand;
4024
import com.marklogic.appdeployer.impl.SimpleAppDeployer;
4125
import com.marklogic.client.DatabaseClient;
4226
import com.marklogic.client.FailedRequestException;
@@ -74,6 +58,7 @@
7458
import java.nio.file.attribute.BasicFileAttributes;
7559
import java.util.ArrayList;
7660
import java.util.List;
61+
import java.util.Map;
7762
import java.util.regex.Pattern;
7863

7964
public class DataHub {
@@ -309,107 +294,40 @@ public JsonNode validateUserModules() {
309294
return ev.validate();
310295
}
311296

312-
public List<Command> getCommands() {
297+
public List<Command> getCommandList() {
298+
Map<String, List<Command>> commandMap = getCommands();
313299
List<Command> commands = new ArrayList<>();
300+
for (String name : commandMap.keySet()) {
301+
commands.addAll(commandMap.get(name));
302+
}
303+
return commands;
304+
}
305+
public Map<String, List<Command>> getCommands() {
306+
Map<String, List<Command>> commandMap = new CommandMapBuilder().buildCommandMap();
314307

315-
// Security
316-
List<Command> securityCommands = new ArrayList<>();
317-
securityCommands.add(new DeployRolesCommand());
318-
securityCommands.add(new DeployUsersCommand());
319-
securityCommands.add(new DeployAmpsCommand());
320-
securityCommands.add(new DeployCertificateTemplatesCommand());
321-
securityCommands.add(new DeployCertificateAuthoritiesCommand());
322-
securityCommands.add(new DeployExternalSecurityCommand());
323-
securityCommands.add(new DeployPrivilegesCommand());
324-
securityCommands.add(new DeployProtectedCollectionsCommand());
325-
commands.addAll(securityCommands);
326-
327-
// Databases
328308
List<Command> dbCommands = new ArrayList<>();
329-
330-
// deploy hub databases (staging, final, job, trace)
331309
dbCommands.add(new DeployHubDatabasesCommand(hubConfig));
332-
333-
// deploy user databases in user-config dir
334310
dbCommands.add(new DeployHubOtherDatabasesCommand(hubConfig));
335-
336-
// depoloy triggers database
337311
dbCommands.add(new DeployHubTriggersDatabaseCommand(hubConfig));
338-
339-
// depoloy schemas database
340312
dbCommands.add(new DeployHubSchemasDatabaseCommand(hubConfig));
341-
commands.addAll(dbCommands);
342-
343-
// Schemas
344-
LoadSchemasCommand lsc = new LoadSchemasCommand();
345-
commands.add(lsc);
313+
commandMap.put("mlDatabaseCommands", dbCommands);
346314

347-
// App servers
348-
// deploy hub app servers (staging, final, job, trace)
349-
commands.add(new DeployHubServersCommand(hubConfig));
315+
// don't deploy rest api servers
316+
commandMap.remove("mlRestApiCommands");
350317

351-
// deploy user app servers in user-config
318+
List<Command> serverCommands = new ArrayList<>();
319+
serverCommands.add(new DeployHubServersCommand(hubConfig));
352320
DeployOtherServersCommand otherServersCommand = new DeployOtherServersCommand();
353321
otherServersCommand.setFilenamesToIgnore("staging-server.json", "final-server.json", "job-server.json", "trace-server.json");
354-
commands.add(otherServersCommand);
322+
serverCommands.add(otherServersCommand);
323+
commandMap.put("mlServerCommands", serverCommands);
355324

356-
// Modules
357-
commands.add(new LoadHubModulesCommand(hubConfig));
358-
commands.add(new LoadUserModulesCommand(hubConfig));
359-
360-
// Alerting
361-
List<Command> alertCommands = new ArrayList<>();
362-
alertCommands.add(new DeployAlertConfigsCommand());
363-
alertCommands.add(new DeployAlertActionsCommand());
364-
alertCommands.add(new DeployAlertRulesCommand());
365-
commands.addAll(alertCommands);
366-
367-
// CPF
368-
List<Command> cpfCommands = new ArrayList<>();
369-
cpfCommands.add(new DeployCpfConfigsCommand());
370-
cpfCommands.add(new DeployDomainsCommand());
371-
cpfCommands.add(new DeployPipelinesCommand());
372-
commands.addAll(cpfCommands);
373-
374-
// Flexrep
375-
List<Command> flexrepCommands = new ArrayList<>();
376-
flexrepCommands.add(new DeployConfigsCommand());
377-
flexrepCommands.add(new DeployTargetsCommand());
378-
flexrepCommands.add(new DeployFlexrepCommand());
379-
commands.addAll(flexrepCommands);
380-
381-
// Groups
382-
List<Command> groupCommands = new ArrayList<>();
383-
groupCommands.add(new DeployGroupsCommand());
384-
commands.addAll(groupCommands);
385-
386-
List<Command> mimetypeCommands = new ArrayList<>();
387-
mimetypeCommands.add(new DeployMimetypesCommand());
388-
commands.addAll(mimetypeCommands);
389-
390-
// Forest replicas
391-
List<Command> replicaCommands = new ArrayList<>();
392-
replicaCommands.add(new ConfigureForestReplicasCommand());
393-
commands.addAll(replicaCommands);
394-
395-
// Tasks
396-
List<Command> taskCommands = new ArrayList<>();
397-
taskCommands.add(new DeployScheduledTasksCommand());
398-
commands.addAll(taskCommands);
399-
400-
// Triggers
401-
List<Command> triggerCommands = new ArrayList<>();
402-
triggerCommands.add(new DeployTriggersCommand());
403-
commands.addAll(triggerCommands);
404-
405-
// SQL Views
406-
List<Command> viewCommands = new ArrayList<>();
407-
DeployViewSchemasCommand deployViewSchemasCommand = new DeployViewSchemasCommand();
408-
deployViewSchemasCommand.setDatabaseIdOrName(hubConfig.finalDbName);
409-
viewCommands.add(deployViewSchemasCommand);
410-
commands.addAll(viewCommands);
325+
List<Command> moduleCommands = new ArrayList<>();
326+
moduleCommands.add(new LoadHubModulesCommand(hubConfig));
327+
moduleCommands.add(new LoadUserModulesCommand(hubConfig));
328+
commandMap.put("mlModuleCommands", moduleCommands);
411329

412-
return commands;
330+
return commandMap;
413331
}
414332

415333
/**
@@ -430,7 +348,7 @@ public void install(HubDeployStatusListener listener) {
430348

431349
AppConfig config = hubConfig.getAppConfig();
432350
HubAppDeployer deployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener);
433-
deployer.setCommands(getCommands());
351+
deployer.setCommands(getCommandList());
434352
deployer.deploy(config);
435353
}
436354

@@ -450,7 +368,7 @@ public void uninstall(HubDeployStatusListener listener) {
450368

451369
AppConfig config = hubConfig.getAppConfig();
452370
HubAppDeployer deployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener);
453-
deployer.setCommands(getCommands());
371+
deployer.setCommands(getCommandList());
454372
deployer.undeploy(config);
455373
}
456374

marklogic-data-hub/src/test/java/com/marklogic/hub/EndToEndTestSjsJson.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ public void runFlows() throws IOException, ParserConfigurationException, SAXExce
9999
}
100100

101101
JsonNode node = jobDocMgr.read("/jobs/" + jobExecution.getJobId() + ".json").next().getContent(new JacksonHandle()).get();
102-
Assert.assertEquals(Long.toString(jobExecution.getJobId()), node.get("jobId").asText());
103-
Assert.assertEquals(TEST_SIZE, node.get("successfulEvents").asInt());
104-
Assert.assertEquals(0, node.get("failedEvents").asInt());
105-
Assert.assertEquals(TEST_SIZE / BATCH_SIZE, node.get("successfulBatches").asInt());
106-
Assert.assertEquals(0, node.get("failedBatches").asInt());
107-
Assert.assertEquals("FINISHED", node.get("status").asText());
102+
String nodeStr = node.toString();
103+
logger.info(nodeStr);
104+
Assert.assertEquals(nodeStr, Long.toString(jobExecution.getJobId()), node.get("jobId").asText());
105+
Assert.assertEquals(nodeStr, TEST_SIZE, node.get("successfulEvents").asInt());
106+
Assert.assertEquals(nodeStr, 0, node.get("failedEvents").asInt());
107+
Assert.assertEquals(nodeStr, TEST_SIZE / BATCH_SIZE, node.get("successfulBatches").asInt());
108+
Assert.assertEquals(nodeStr, 0, node.get("failedBatches").asInt());
109+
Assert.assertEquals(nodeStr, "FINISHED", node.get("status").asText());
108110
}
109111

110112
@Test

ml-data-hub-plugin/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
maven { url 'http://developer.marklogic.com/maven2' }
55
}
66
dependencies {
7-
classpath "com.gradle.publish:plugin-publish-plugin:0.9.6"
7+
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
88
}
99
}
1010

@@ -13,7 +13,7 @@ plugins {
1313
id "groovy"
1414
id "java-gradle-plugin"
1515
id "maven-publish"
16-
id "com.jfrog.bintray" version "1.7.1"
16+
id "com.jfrog.bintray" version "1.7.3"
1717
}
1818

1919
apply plugin: "com.gradle.plugin-publish"
@@ -31,7 +31,7 @@ dependencies {
3131
compile gradleApi()
3232
compile project(":marklogic-data-hub")
3333
compile 'com.marklogic:marklogic-xcc:8.0.6'
34-
compile 'com.marklogic:ml-gradle:2.5.0'
34+
compile 'com.marklogic:ml-gradle:2.6.0'
3535

3636
testCompile localGroovy()
3737
testCompile gradleTestKit()

ml-data-hub-plugin/src/main/groovy/com/marklogic/gradle/DataHubPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DataHubPlugin implements Plugin<Project> {
5454
String flowGroup = "MarkLogic Data Hub Flow Management"
5555
project.task("hubRunFlow", group: flowGroup, type: RunFlowTask)
5656

57-
logger.info("Finished initializing ml-gradle\n")
57+
logger.info("Finished initializing ml-data-hub\n")
5858
}
5959

6060
void initializeProjectExtensions(Project project) {
@@ -72,6 +72,6 @@ class DataHubPlugin implements Plugin<Project> {
7272
throw new RuntimeException("You must apply the ml-gradle plugin before the ml-datahub plugin.")
7373
}
7474

75-
mlAppDeployer.setCommands(dataHub.getCommands())
75+
mlAppDeployer.setCommands(dataHub.getCommandList())
7676
}
7777
}

quick-start/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ plugins {
1515
id 'java'
1616
id 'eclipse'
1717
id 'idea'
18-
id 'com.eriwen.gradle.js' version '1.12.1'
1918
id 'com.moowork.node' version '1.1.1'
2019
}
2120

@@ -51,7 +50,7 @@ dependencies {
5150

5251
// Needed for the Upload feature using mlcp
5352
compile("com.marklogic:mlcp-util:0.3.0")
54-
compile("com.marklogic:mlcp:8.0-5")
53+
compile("com.marklogic:mlcp:8.0.6.3")
5554
compile("com.marklogic:marklogic-spring-web:1.0")
5655

5756
testCompile("junit:junit")

0 commit comments

Comments
 (0)