Skip to content

Commit fa34941

Browse files
committed
MLE-24230 Added wait function
Using new ml-gradle task
1 parent c6c2d9e commit fa34941

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

Jenkinsfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ def runTests() {
1010
npm --version
1111
npm ci
1212
13-
cd test-app
14-
./gradlew -i mlTestConnections
15-
./gradlew -i mlDeploy
13+
cd test-app
14+
./gradlew -i mlWaitTillReady
15+
./gradlew -i mlTestConnections
16+
./gradlew -i mlDeploy
1617
1718
cd ..
1819
rm -rf $WORKSPACE/*.xml || true
@@ -33,8 +34,6 @@ def runDockerCompose(String markLogicDockerImage) {
3334
cd node-client-api
3435
echo "Running docker compose with MarkLogic image: ''' + markLogicDockerImage + '''"
3536
MARKLOGIC_LOGS_VOLUME=/tmp MARKLOGIC_IMAGE=''' + markLogicDockerImage + ''' docker-compose up -d --build
36-
echo "Waiting 90s for MarkLogic to be ready to accept connections"
37-
sleep 90s;
3837
'''
3938
}
4039

test-app/build.gradle

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
// Only used for setting up the test AppServer in MarkLogic
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
// Needed for ml-gradle 6.2-SNAPSHOT mavenLocal()
5+
maven {
6+
url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
7+
}
8+
}
9+
dependencies {
10+
classpath "com.marklogic:ml-gradle:6.2-SNAPSHOT"
11+
}
12+
}
13+
214
plugins {
3-
id 'net.saliman.properties' version '1.5.2'
4-
// Sticking with 5.0.0 until a bug in 6.0.x is fixed where LSQT config isn't deployed correctly.
5-
id "com.marklogic.ml-gradle" version "5.0.0"
15+
id "net.saliman.properties" version "1.5.2"
16+
}
17+
18+
apply plugin: "com.marklogic.ml-gradle"
19+
20+
// Using default values, including this to show how to configure the task.
21+
mlWaitTillReady {
22+
waitInterval = 2000
23+
maxAttempts = 30
624
}
725

826
tasks.register("addMarkLogic12SchemasIfNecessary", com.marklogic.gradle.task.MarkLogicTask) {
@@ -22,9 +40,9 @@ mlLoadSchemas.dependsOn addMarkLogic12SchemasIfNecessary
2240
* that requires SSL.
2341
*/
2442
ext {
25-
def command = new com.marklogic.appdeployer.command.security.GenerateTemporaryCertificateCommand()
26-
command.setTemplateIdOrName("node-client-ssl-template")
27-
command.setCommonName("localhost")
28-
command.setValidFor(365)
29-
mlAppDeployer.commands.add(command)
43+
def command = new com.marklogic.appdeployer.command.security.GenerateTemporaryCertificateCommand()
44+
command.setTemplateIdOrName("node-client-ssl-template")
45+
command.setCommonName("localhost")
46+
command.setValidFor(365)
47+
mlAppDeployer.commands.add(command)
3048
}

0 commit comments

Comments
 (0)