Skip to content

Instantly share code, notes, and snippets.

@derms
Last active December 3, 2018 16:11
Show Gist options
  • Save derms/d80bac901682c22006aa0b4c37624146 to your computer and use it in GitHub Desktop.
Save derms/d80bac901682c22006aa0b4c37624146 to your computer and use it in GitHub Desktop.
DHF 4.0.3 - generate tde's from entities and load them into final db
  1. Run the hubGenerateTDETemplates command
./gradlew hubGenerateTDETemplates
  1. Run the mlLoadFinalSchemas command
./gradlew mlLoadFinalSchemas
buildscript {
repositories {
maven {url 'http://developer.marklogic.com/maven2/'}
}
}
plugins {
id 'java'
id 'net.saliman.properties' version '1.4.6'
id 'com.marklogic.ml-data-hub' version '4.0.3'
}
repositories {
jcenter()
maven {url 'http://developer.marklogic.com/maven2/'}
}
dependencies {
// this allows you to write custom java code that depends
// on the Data Hub Framework library
compile 'com.marklogic:marklogic-data-hub:4.0.3'
compile 'com.marklogic:marklogic-xcc:9.0.4'
}
hubGenerateTDETemplates.doLast {
copy {
from "$hubConfig.stagingAppConfig.schemasPath/tde"
into "$hubConfig.finalAppConfig.schemasPath/tde"
exclude "*-GENERATED*"
}
}
class LoadFinalSchemasTask extends com.marklogic.gradle.task.HubTask {
@org.gradle.api.tasks.TaskAction
void loadSchemas() {
def cc = new com.marklogic.appdeployer.command.CommandContext(hubConfig.finalAppConfig,null,null)
def command = new com.marklogic.appdeployer.command.schemas.LoadSchemasCommand()
command.execute(cc)
}
}
task mlLoadFinalSchemas(type:LoadFinalSchemasTask)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment