Skip to content

Commit 405c24a

Browse files
committed
fixing upgrade code
1 parent 336ee34 commit 405c24a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ public boolean updateHubFrom110() {
482482
text = Pattern.compile("^(\\s*)compile.+marklogic-data-hub.+$", Pattern.MULTILINE).matcher(text).replaceAll("$1compile 'com.marklogic:marklogic-data-hub:" + version + "'");
483483
FileUtils.writeStringToFile(buildGradle, text);
484484

485+
hubConfig.getHubSecurityDir().resolve("roles").resolve("data-hub-user.json").toFile().delete();
486+
485487
// step 3: install hub modules into MarkLogic
486488
install();
487489

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class HubConfig {
6060
public static final String DEFAULT_TRIGGERS_DB_NAME = "data-hub-TRIGGERS";
6161
public static final String DEFAULT_SCHEMAS_DB_NAME = "data-hub-SCHEMAS";
6262

63-
public static final String DEFAULT_ROLE_NAME = "data-hub-ROLE";
63+
public static final String DEFAULT_ROLE_NAME = "data-hub-role";
6464
public static final String DEFAULT_USER_NAME = "data-hub-user";
6565

6666
public static final Integer DEFAULT_STAGING_PORT = 8010;
@@ -542,21 +542,25 @@ public Map<String, String> getCustomTokens(Map<String, String> customTokens) {
542542
customTokens.put("\"%%mlStagingPort%%\"", stagingPort.toString());
543543
customTokens.put("%%mlStagingDbName%%", stagingDbName);
544544
customTokens.put("%%mlStagingForestsPerHost%%", stagingForestsPerHost.toString());
545+
customTokens.put("%%mlStagingAuth%%", stagingAuthMethod);
545546

546547
customTokens.put("%%mlFinalAppserverName%%", finalHttpName);
547548
customTokens.put("\"%%mlFinalPort%%\"", finalPort.toString());
548549
customTokens.put("%%mlFinalDbName%%", finalDbName);
549550
customTokens.put("%%mlFinalForestsPerHost%%", finalForestsPerHost.toString());
551+
customTokens.put("%%mlFinalAuth%%", finalAuthMethod);
550552

551553
customTokens.put("%%mlTraceAppserverName%%", traceHttpName);
552554
customTokens.put("\"%%mlTracePort%%\"", tracePort.toString());
553555
customTokens.put("%%mlTraceDbName%%", traceDbName);
554556
customTokens.put("%%mlTraceForestsPerHost%%", traceForestsPerHost.toString());
557+
customTokens.put("%%mlTraceAuth%%", traceAuthMethod);
555558

556559
customTokens.put("%%mlJobAppserverName%%", jobHttpName);
557560
customTokens.put("\"%%mlJobPort%%\"", jobPort.toString());
558561
customTokens.put("%%mlJobDbName%%", jobDbName);
559562
customTokens.put("%%mlJobForestsPerHost%%", jobForestsPerHost.toString());
563+
customTokens.put("%%mlJobAuth%%", jobAuthMethod);
560564

561565
customTokens.put("%%mlModulesDbName%%", modulesDbName);
562566
customTokens.put("%%mlModulesForestsPerHost%%", modulesForestsPerHost.toString());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public void init() {
6969
rolesDir.toFile().mkdirs();
7070
usersDir.toFile().mkdirs();
7171

72-
writeResourceFileWithReplace("ml-config/security/roles/data-hub-user.json", rolesDir.resolve("data-hub-user.json"), true);
73-
writeResourceFileWithReplace("ml-config/security/users/data-hub-user.json", usersDir.resolve("data-hub-user.json"), true);
72+
writeResourceFile("ml-config/security/roles/data-hub-role.json", rolesDir.resolve("data-hub-role.json"), true);
73+
writeResourceFile("ml-config/security/users/data-hub-user.json", usersDir.resolve("data-hub-user.json"), true);
7474

7575
Path mimetypesDir = hubConfig.getHubMimetypesDir();
7676
mimetypesDir.toFile().mkdirs();

0 commit comments

Comments
 (0)