-
Notifications
You must be signed in to change notification settings - Fork 53
MLE-24531 Converting Jenkinsfile to use Docker #974
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,6 @@ | ||||||||||||||||||||||||||||||||||
| @Library('shared-libraries') _ | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| def runTests(String type,String version){ | ||||||||||||||||||||||||||||||||||
| copyRPM type,version | ||||||||||||||||||||||||||||||||||
| setUpML '$WORKSPACE/xdmp/src/Mark*.rpm' | ||||||||||||||||||||||||||||||||||
| def runTests(){ | ||||||||||||||||||||||||||||||||||
| sh ''' | ||||||||||||||||||||||||||||||||||
| export JAVA_HOME=$JAVA_HOME_DIR | ||||||||||||||||||||||||||||||||||
| export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR | ||||||||||||||||||||||||||||||||||
|
|
@@ -11,8 +9,11 @@ def runTests(String type,String version){ | |||||||||||||||||||||||||||||||||
| node --version | ||||||||||||||||||||||||||||||||||
| npm --version | ||||||||||||||||||||||||||||||||||
| npm ci | ||||||||||||||||||||||||||||||||||
| cd test-app | ||||||||||||||||||||||||||||||||||
| ./gradlew -i mlDeploy -g $PWD | ||||||||||||||||||||||||||||||||||
| ./gradlew -i mlTestConnections | ||||||||||||||||||||||||||||||||||
| ./gradlew -i mlDeploy | ||||||||||||||||||||||||||||||||||
| cd .. | ||||||||||||||||||||||||||||||||||
| rm -rf $WORKSPACE/*.xml || true | ||||||||||||||||||||||||||||||||||
| ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-basic-reports.xml -g \'logging|archivePath\' --invert || true | ||||||||||||||||||||||||||||||||||
|
|
@@ -21,6 +22,29 @@ def runTests(String type,String version){ | |||||||||||||||||||||||||||||||||
| ''' | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| def runDockerCompose(String markLogicDockerImage) { | ||||||||||||||||||||||||||||||||||
| cleanupDocker() | ||||||||||||||||||||||||||||||||||
| sh label:'mlsetup', script: '''#!/bin/bash | ||||||||||||||||||||||||||||||||||
| echo "Removing any running MarkLogic server and clean up MarkLogic data directory" | ||||||||||||||||||||||||||||||||||
| sudo /usr/local/sbin/mladmin remove | ||||||||||||||||||||||||||||||||||
| docker-compose down -v || true | ||||||||||||||||||||||||||||||||||
| sudo /usr/local/sbin/mladmin cleandata | ||||||||||||||||||||||||||||||||||
| cd node-client-api/test-app | ||||||||||||||||||||||||||||||||||
| MARKLOGIC_LOGS_VOLUME=/tmp MARKLOGIC_IMAGE='''+markLogicDockerImage+''' docker-compose up -d --build | ||||||||||||||||||||||||||||||||||
| sleep 60s; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| sleep 60s; | |
| # Wait for MarkLogic to be ready by polling the HTTP endpoint | |
| echo "Waiting for MarkLogic to become ready..." | |
| for i in {1..30}; do | |
| if curl -s http://localhost:8001/ > /dev/null; then | |
| echo "MarkLogic is ready!" | |
| break | |
| else | |
| echo "MarkLogic not ready yet, waiting..." | |
| sleep 2 | |
| fi | |
| if [ $i -eq 30 ]; then | |
| echo "MarkLogic did not become ready in time." >&2 | |
| exit 1 | |
| fi | |
| done |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using /tmp for log volume could lead to log loss and potential disk space issues. Consider using a more persistent location or making this configurable.