diff --git a/.gitignore b/.gitignore index 2a4f3463..5598f296 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ tmp .settings .vscode .DS_Store +.gradle docker test-app/build diff --git a/Jenkinsfile b/Jenkinsfile index 5c21ba9b..618c0c0f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,10 @@ def runTests() { npm --version npm ci - cd test-app - ./gradlew -i mlTestConnections - ./gradlew -i mlDeploy + cd test-app + ./gradlew -i mlWaitTillReady + ./gradlew -i mlTestConnections + ./gradlew -i mlDeploy cd .. rm -rf $WORKSPACE/*.xml || true @@ -33,8 +34,6 @@ def runDockerCompose(String markLogicDockerImage) { cd node-client-api echo "Running docker compose with MarkLogic image: ''' + markLogicDockerImage + '''" MARKLOGIC_LOGS_VOLUME=/tmp MARKLOGIC_IMAGE=''' + markLogicDockerImage + ''' docker-compose up -d --build - echo "Waiting 90s for MarkLogic to be ready to accept connections" - sleep 90s; ''' } diff --git a/test-app/build.gradle b/test-app/build.gradle index ed1d1a22..33fe6fbb 100644 --- a/test-app/build.gradle +++ b/test-app/build.gradle @@ -1,8 +1,26 @@ -// Only used for setting up the test AppServer in MarkLogic +buildscript { + repositories { + mavenCentral() + // Needed for ml-gradle 6.2-SNAPSHOT + maven { + url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/" + } + } + dependencies { + classpath "com.marklogic:ml-gradle:6.2-SNAPSHOT" + } +} + plugins { - id 'net.saliman.properties' version '1.5.2' - // Sticking with 5.0.0 until a bug in 6.0.x is fixed where LSQT config isn't deployed correctly. - id "com.marklogic.ml-gradle" version "5.0.0" + id "net.saliman.properties" version "1.5.2" +} + +apply plugin: "com.marklogic.ml-gradle" + +// Using longer values as MarkLogic seems to take much longer to initialize with the Jenkins nodeclientpool. +mlWaitTillReady { + waitInterval = 3000 + maxAttempts = 40 } tasks.register("addMarkLogic12SchemasIfNecessary", com.marklogic.gradle.task.MarkLogicTask) { @@ -22,9 +40,9 @@ mlLoadSchemas.dependsOn addMarkLogic12SchemasIfNecessary * that requires SSL. */ ext { - def command = new com.marklogic.appdeployer.command.security.GenerateTemporaryCertificateCommand() - command.setTemplateIdOrName("node-client-ssl-template") - command.setCommonName("localhost") - command.setValidFor(365) - mlAppDeployer.commands.add(command) + def command = new com.marklogic.appdeployer.command.security.GenerateTemporaryCertificateCommand() + command.setTemplateIdOrName("node-client-ssl-template") + command.setCommonName("localhost") + command.setValidFor(365) + mlAppDeployer.commands.add(command) }