'Deploy a specific MarkLogic Database configuration using ml-gradle
Is there a CLI argument or parameter to deploy configuration of a particular database instead of deploying all the database configurations under src/main/ml-config/databases?
e.g. when I use the gradle mlDeployDatabases command, it deploys all the database configurations.
I am looking for an argument like -PmlDatabaseName=Database1 that lets me deploy just the Database1 DB.
gradle mlDeployDatabases -PmlDatabaseName=Database1
Solution 1:[1]
There are a couple of properties that can be used to either include or exclude resource files:
https://github.com/marklogic-community/ml-gradle/wiki/Property-reference#other-resource-properties
mlResourceFilenamesToExcludeRegexNew in 3.0.0 - regex that defines resource filenames to exclude from processing (exclude = ignore). Useful for when you want to exclude a set of resources when deploying to a certain environment. Cannot be set whenmlResourceFilenamesToIncludeRegexis also set. No default value.mlResourceFilenamesToIgnoreComma-separated list of resource filenames that should be ignored and not deployed. Useful for when different environments require different resources to be deployed. No default value.mlResourceFilenamesToIncludeRegex
New in 3.0.0 - regex that defines resource filenames to include. If a filename doesn't match this regex, then it will be excluded (ignored). Cannot be set whenmlResourceFilenamesToExcludeRegexis also set. No default value.
If your "Database1" file was "Database1.json", then something like:
gradle mlDeployDatabases -PmlResourceFilenamesToIncludeRegex=Database1.json
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mads Hansen |
