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

Deploying resources to databases

rjrudin edited this page Sep 28, 2018 · 8 revisions

The following resource types are all deployed "to" a database - i.e. deploying each of them results in documents being inserted into a database:

  • Alerts
  • Flexible Replication
  • Temporal (for configuring bi-temporal support)
  • View schemas (for configuring e.g. SQL access)
  • Triggers (as of version 3.6.2)

Until version 2.9.0 of ml-app-deployer, support was only provided for deploying these resource types into the application's main content database. And the files for each resource type were expected to be found in the root configuration directory. So you could have a setup like this:

/alert/configs/my-config.json
/databases/content-database.json
/flexrep/configs/my-config.xml
/view-schemas/my-schema.json
/temporal/axis/my-axis.json

And that worked just fine when you only wanted to deploy these resources to your application's main content database.

Version 2.9.0 of ml-app-deployer now provides support for deploying these resources into any database. The key is where the resource files are located. Instead of being located in the top-level directories above, they must be placed under a directory under "databases" that is named after the database that the resources are deployed to.

Note that for triggers, the name of the database in the path should be the name of the triggers database. For example, if you have two triggers databases named "triggers1" and "triggers2", you could deploy different triggers to them via the following directories:

./ml-config/databases/triggers1/triggers
./ml-config/databases/triggers2/triggers

Example

If you want to deploy an alert configuration to a database named "my-other-content-database", you'd have the following setup:

/databases/my-other-content-database.json (the name of this file doesn't matter)
/databases/my-other-content-database/alert/configs/my-config.json

Each directory named after a database then acts as a "mini" configuration directory. Similar to "alert", you can also have "flexrep", "temporal", and "view-schemas" directories under "my-other-content-database", with each containing resources that will be deployed to my-other-content-database.

Note that for temporal and view-schemas, the resources are deployed to the schemas database associated with the content database. So if you have two content databases that share the same schemas database, you only need to define temporal and view-schemas for one of those databases.

Clone this wiki locally