3

I currently have a super / sub database setup and would like to know the best way to deploy a fresh install via ml-gradle 2.7.0.

I have gotten it to work by removing the following file from my config directory for the first pass mlDeploy.

{
  "database-name" : "my-documents",
  "subdatabase" : [ {
    "database-name" : "my-seconddb"
  }, {
    "database-name" : "my-thirddb"
  } ]
}

After all of the databases are established for the first time, adding that back to the directory and re-running mlDeploy corrects the setup.

Additionally, I would like to keep the indexing settings for all three databases in one file if possible. Is there currently any way to do that?

Thank you for this time saving tool. So far it is much easier to use than Roxy.

Simplest configuration:

src/main/ml-config/databases/1-my-firstsub.json
{
  "database-name" : "my-firstsub"
}

src/main/ml-config/databases/2-my-nextsub.json
{
  "database-name" : "my-nextsub"
}

src/main/ml-config/databases/6-my-documents.json
{
  "database-name" : "my-documents",
  "subdatabase" : [ {
    "database-name" : "my-firstsub"
  }, {
    "database-name" : "my-nextsub"
  } ]
}
H. Garrow
  • 75
  • 4

1 Answers1

2

It's not yet possible to store multiple databases in one file. I've tried to avoid inventing new schemas beyond what the Manage API defines, so it's one database per file.

You can control the order in which each database is created by the database filename - e.g. if you need my-seconddb and my-thirddb created before my-documents, use filenames of "1-my-seconddb.json", "2-my-thirddb.json", "and "3-my-documents.json". That should allow for my-documents to have subdatabases in it, as the other databases will have already been created.

rjrudin
  • 2,108
  • 9
  • 7
  • The only problem I then run into is the need to have a content-database.json file defined, which is where I put my super database configuration into. – H. Garrow May 24 '17 at 14:29
  • You don't have to use content-database.json, it's just a file that ml-gradle will look for by default. – rjrudin May 30 '17 at 12:29
  • I reduced the config to just the database configuration stubs, and I do still get a failure on establishing the super database on the first pass. If the database is created first, then the super database configuration works. I haven't been able to get super databases to configure in fewer than two runs. – H. Garrow May 31 '17 at 18:17
  • Can you open an issue at https://github.com/marklogic-community/ml-gradle/issues for this? Please use the example above, that should suffice for reproducing and fixing. – rjrudin Jun 05 '17 at 12:22