Created
February 25, 2019 11:06
-
-
Save derms/8306a822de9a2093513d5db98fd45ae4 to your computer and use it in GitHub Desktop.
basic to digest switching during MarkLogic gradle deployment
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
task setStagingDatabaseToDigest(type: com.marklogic.gradle.task.MarkLogicTask) { | |
doFirst{ | |
def mc = getManageClient() | |
if(mc.getJson("/manage/v2/servers?view=status&group-id=Default").contains('"' + mlStagingAppserverName + '"')) { | |
mc.putJson("/manage/v2/servers/" + mlStagingAppserverName + "/properties?group-id=Default", '{"authentication":"digest"}') | |
} | |
} | |
} | |
task setStagingDatabaseToBasic(type: com.marklogic.gradle.task.MarkLogicTask) { | |
doFirst{ | |
def mc = getManageClient() | |
if(mc.getJson("/manage/v2/servers?view=status&group-id=Default").contains('"' + mlStagingAppserverName + '"')) { | |
mc.putJson("/manage/v2/servers/" + mlStagingAppserverName + "/properties?group-id=Default", '{"authentication":"basic"}') | |
} | |
} | |
} | |
mlPrepareRestApiDependencies.dependsOn setStagingDatabaseToDigest | |
mlPostDeploy.dependsOn setStagingDatabaseToBasic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment