Skip to content

Commit a73f6f1

Browse files
vitalykorolevVitaly Korolev
and
Vitaly Korolev
authored
Feature/CLD-484 (#87)
* Fixed PR template * Updated copyright year * reformat and add conditional init * format shell script * Squashed commit of the following: commit 3b78c9b Author: Vitaly <[email protected]> Date: Wed May 18 15:24:55 2022 -0700 Rename yml files to yaml (#83) (#84) Co-authored-by: Vitaly Korolev <[email protected]> Co-authored-by: Vitaly Korolev <[email protected]> commit 1e6c239 Author: Vitaly <[email protected]> Date: Wed May 18 10:03:11 2022 -0700 Feature/CLD-420 (#81) (#82) * Replace all instances of yml with yaml * Fix docker test cases * Increase wait and add port to report output * add -s to curl and remove secrets processing * Strict condition checks & bash style improvements * Adding test cases for uncoupled cluster * Additional shellCheck fixes * move checkpoint file creation to the end Co-authored-by: Vitaly Korolev <[email protected]>
1 parent 3b78c9b commit a73f6f1

11 files changed

+314
-134
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
- ##### Owner:
66

7-
- [ ] JIRA_ID as part of branch name
7+
- [ ] JIRA_ID as part of branch/PR name
88
- [ ] Rebase the branch with upstream
99
- [ ] Squashed all commits into a single commit
1010
- [ ] Added Tests
1111

1212
- ##### Reviewer:
1313

1414
- [ ] Reviewed Tests
15-
- [ ] Added to Release Wiki
15+
- [ ] Added to Release Wiki/Jira

Jenkinsfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,15 @@ def DockerRunTests() {
216216
def defaultParams='-it -d -p 8000:8000 -p 8001:8001 -p 8002:8002 -p7997:7997'
217217
def curlCommand='curl -sL'
218218
def curlCommandAuth='curl -sL --anyauth -u test_admin:test_admin_pass'
219-
def composePath='./docker-compose/'
220219
def jUnitReport = "docker-test-results.xml"
221220
def testCases = readJSON file: './test/docker-test-cases.json'
222221

223222
//validate JSON data
224223
assert testCases instanceof Map
225224

226225
//create credential files for compose
227-
writeFile(file: "${composePath}mldb_admin_username.txt", text: "test_admin")
228-
writeFile(file: "${composePath}mldb_admin_password.txt", text: "test_admin_pass")
226+
writeFile(file: "./docker-compose/mldb_admin_username.txt", text: "test_admin")
227+
writeFile(file: "./docker-compose/mldb_admin_password.txt", text: "test_admin_pass")
229228

230229
def testResults = ''
231230
def totalTests = 0
@@ -241,11 +240,11 @@ def DockerRunTests() {
241240
// if .yaml config is provided in params, start compose. otherwise docker run is used
242241
if ( value.params.toString().contains(".yaml")) {
243242
//update image label in yaml file
244-
composeFile = readFile(composePath + value.params)
243+
composeFile = readFile(value.params)
245244
composeFile = composeFile.replaceFirst(/image: .*/, "image: "+testImage)
246-
writeFile( file: composePath + value.params, text: composeFile)
245+
writeFile( file: value.params, text: composeFile)
247246
// start docker compose
248-
sh( returnStdout: true, script: "docker compose -f ${composePath}${value.params} up -d" )
247+
sh( returnStdout: true, script: "docker compose -f ${value.params} up -d" )
249248
} else {
250249
//insert valid license data in parameters
251250
value.params = value.params.toString().replaceAll("LICENSE_PLACEHOLDER", "LICENSEE='MarkLogic - Version 9 QA Test License' -e LICENSE_KEY=\"${env.QA_LICENSE_KEY}\"")
@@ -300,7 +299,7 @@ def DockerRunTests() {
300299
}
301300
echo "-Deleting resources"
302301
if ( value.params.toString().contains(".yaml")) {
303-
sh( returnStdout: true, script: "docker compose -f ${composePath}${value.params} down" )
302+
sh( returnStdout: true, script: "docker compose -f ${value.params} down" )
304303
} else {
305304
sh( returnStdout: true, script: "docker rm -f ${testCont}" )
306305
}

dockerFiles/dockerfile-marklogic-server-centos

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
###############################################################
22
#
3-
# Copyright (c) 2021 MarkLogic Corporation
3+
# Copyright (c) 2022 MarkLogic Corporation
44
#
55
###############################################################
66
FROM ml-docker-dev.marklogic.com/marklogic/marklogic-server-centos:10.0-7.3_1.0.0_EA

dockerFiles/marklogic-deps-centos:base

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
###############################################################
22
#
3-
# Copyright (c) 2021 MarkLogic Corporation
3+
# Copyright (c) 2022 MarkLogic Corporation
44
#
55
###############################################################
66

dockerFiles/marklogic-server-centos:base

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
###############################################################
22
#
3-
# Copyright (c) 2021 MarkLogic Corporation
3+
# Copyright (c) 2022 MarkLogic Corporation
44
#
55
###############################################################
66

src/centos/scripts/join-cluster.sh

+4-28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22
###############################################################
33
#
4-
# Copyright 2019 MarkLogic Corporation. All Rights Reserved.
4+
# Copyright 2022 MarkLogic Corporation. All Rights Reserved.
55
#
66
###############################################################
77
# join host to cluster
@@ -11,46 +11,22 @@
1111
#
1212
###############################################################
1313

14-
################################################################
15-
# check if admin password is a secret or env var
16-
################################################################
17-
SECRET_USR_FILE=/run/secrets/${MARKLOGIC_ADMIN_USERNAME_FILE}
18-
SECRET_PWD_FILE=/run/secrets/${MARKLOGIC_ADMIN_PASSWORD_FILE}
19-
20-
if [[ -f "$SECRET_PWD_FILE" ]] && [[ ! -z "$(<"$SECRET_PWD_FILE")" ]]
21-
then
22-
echo "using docker secrets for credentials"
23-
ML_ADMIN_PASSWORD=$(<"$SECRET_PWD_FILE")
24-
else
25-
echo "using ENV for credentials"
26-
ML_ADMIN_PASSWORD=$MARKLOGIC_ADMIN_PASSWORD
27-
fi
28-
29-
if [[ -f "$SECRET_USR_FILE" ]] && [[ ! -z "$(<"$SECRET_USR_FILE")" ]]
30-
then
31-
echo "using docker secrets for credentials"
32-
ML_ADMIN_USERNAME=$(<"$SECRET_USR_FILE")
33-
else
34-
echo "using ENV for credentials"
35-
ML_ADMIN_USERNAME=$MARKLOGIC_ADMIN_USERNAME
36-
fi
37-
3814
cluster=${1:-${MARKLOGIC_BOOTSTRAP_HOST}}
3915
joiner=${2:-localhost}
4016
user=${3:-${ML_ADMIN_USERNAME}}
4117
pass=${4:-${ML_ADMIN_PASSWORD}}
4218

43-
curl -o host.xml --anyauth --user $user:$pass -X GET -H "Accept: application/xml" \
19+
curl -s -o host.xml --anyauth --user $user:$pass -X GET -H "Accept: application/xml" \
4420
http://${joiner}:8001/admin/v1/server-config
4521

46-
curl -v --anyauth --user $user:$pass -X POST -d "group=Default" \
22+
curl -s -v --anyauth --user $user:$pass -X POST -d "group=Default" \
4723
--data-urlencode "server-config@./host.xml" \
4824
-H "Content-type: application/x-www-form-urlencoded" \
4925
-o cluster.zip http://${cluster}:8001/admin/v1/cluster-config
5026

5127
sleep 10s
5228

53-
curl -v --anyauth --user $user:$pass -X POST -H "Content-type: application/zip" \
29+
curl -s -v --anyauth --user $user:$pass -X POST -H "Content-type: application/zip" \
5430
--data-binary @./cluster.zip \
5531
http://${joiner}:8001/admin/v1/cluster-config
5632

0 commit comments

Comments
 (0)