Last active
April 19, 2019 11:12
-
-
Save derms/774f33b70edc1bc3aed5026cb893927e to your computer and use it in GitHub Desktop.
MarkLogic - Multiple Delete Collections tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomDeleteCollectionsTask extends com.marklogic.gradle.task.datamovement.DataMovementTask { | |
String[] collections | |
@org.gradle.api.tasks.TaskAction | |
void deleteCollections() { | |
project.ext.collections = (collections != null && collections.length > 0) ? collections.join(",") : null | |
runQueryBatcherJob(new com.marklogic.client.ext.datamovement.job.DeleteCollectionsJob()) | |
} | |
} | |
task deleteFinalData(type: CustomDeleteCollectionsTask) { | |
client = hubConfig.newFinalClient() | |
collections = ["Document","Client"] | |
} | |
task deleteStagingData(type: CustomDeleteCollectionsTask) { | |
client = hubConfig.newStagingClient() | |
collections = ["input"] | |
} | |
task deleteAllData(dependsOn: [deleteStagingData,deleteFinalData]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment