marklogic-community / grove-ml-gradle

Other
1 stars 3 forks source link

Example tasks to import/export content as MLCP archive #6

Closed grtjn closed 4 years ago

grtjn commented 5 years ago
task exportContent(type: com.marklogic.gradle.task.MlcpTask) {
  systemProperty "java.library.path", "mlcp/lib/native"
  classpath = configurations.mlcp
  command = "EXPORT"
  port = mlAppConfig.restPort
  output_file_path = "export/" + getDate()
  output_type = "archive"
}

task importContent(type: com.marklogic.gradle.task.MlcpTask) {
  systemProperty "java.library.path", "mlcp/lib/native"
  classpath = configurations.mlcp
  command = "IMPORT"
  port = mlAppConfig.restPort
  input_file_path = "export/"
  input_file_type = "archive"
}

def getDate() {
  return new Date().format('yyyyMMdd-HHmmss')
}