Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/4.6.0 #672

Merged
merged 19 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DEVEXP-545 Added mlTestConnections
  • Loading branch information
rjrudin committed Aug 30, 2023
commit e7797cc89e5ec6ac13b3a238076816d7e0a49d96
3 changes: 3 additions & 0 deletions src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy
Original file line number Diff line number Diff line change
@@ -132,6 +132,9 @@ class MarkLogicPlugin implements Plugin<Project> {
description: "Deploys application resources in the same manner as mlDeploy, but will not deploy anything that " +
"involves writing data to a database - such as modules, schemas, and triggers - thus making it safe for use " +
"when deploying an application to a replica cluster")
project.task("mlTestConnections", type: TestConnectionsTask, group: deployGroup,
description: "Test each connection ml-gradle will make to MarkLogic; results of each test will be printed, with " +
"an exception being thrown if any connection test fails.")

String adminGroup = "ml-gradle Admin"
project.task("mlInit", type: InitTask, group: adminGroup, description: "Perform a one-time initialization of a MarkLogic server; uses the properties 'mlLicenseKey' and 'mlLicensee'")
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.marklogic.gradle.task

import com.marklogic.appdeployer.command.TestConnectionsCommand
import org.gradle.api.GradleException
import org.gradle.api.tasks.TaskAction

class TestConnectionsTask extends MarkLogicTask {

@TaskAction
void testConnections() {
TestConnectionsCommand.TestResults results = new TestConnectionsCommand().testConnections(getCommandContext())
if (results.anyTestFailed()) {
throw new GradleException("One or more connections failed:\n\n" + results)
} else {
println("\nAll connections succeeded, results are shown below\n")
println(results)
println()
}
}
}