Skip to content

Commit ca72f65

Browse files
committed
CDRIVER-497 factor topology configs in .mci.yml
1 parent 5411f2c commit ca72f65

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

.mci.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ c_driver_variables:
115115
curl -s http://localhost:8889/
116116
start_topology_command: &start_topology_command
117117
start_topology: |
118-
curl -s --data @"$ORCHESTRATION_FILE" "http://localhost:8889/v1/$ORCHESTRATION_PATH"
118+
curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
119119
./mongodb/bin/mongo --eval 'printjson(db.serverBuildInfo())'
120120
./mongodb/bin/mongo --eval 'printjson(db.isMaster())'
121121
@@ -291,78 +291,77 @@ functions:
291291
- key: "mongo_url"
292292
value: ${mongo_url_prefix}${mongo_url_enterprise_keyword|enterprise-}${mongo_url_platform|}latest.${mongo_url_extension|tgz}
293293

294-
# TODO: refactor these, "file" and "path" share parts
295294
"set topology standalone" :
296295
command: expansions.update
297296
params:
298297
updates:
299298
- key: "orchestration_file"
300-
value: "orchestration_configs/servers/auth.json"
301-
- key: "orchestration_path"
302-
value: "servers"
299+
value: "auth.json"
300+
- key: "topology_type"
301+
value: "server"
303302

304303
"set topology replica set" :
305304
command: expansions.update
306305
params:
307306
updates:
308307
- key: "orchestration_file"
309-
value: "orchestration_configs/replica_sets/auth.json"
310-
- key: "orchestration_path"
311-
value: "replica_sets"
308+
value: "auth.json"
309+
- key: "topology_type"
310+
value: "replica_set"
312311

313312
"set topology sharded" :
314313
command: expansions.update
315314
params:
316315
updates:
317316
- key: "orchestration_file"
318-
value: "orchestration_configs/sharded_clusters/auth.json"
319-
- key: "orchestration_path"
320-
value: "sharded_clusters"
317+
value: "auth.json"
318+
- key: "topology_type"
319+
value: "sharded_cluster"
321320

322321
"set topology standalone no auth" :
323322
command: expansions.update
324323
params:
325324
updates:
326325
- key: "orchestration_file"
327-
value: "orchestration_configs/servers/basic.json"
328-
- key: "orchestration_path"
329-
value: "servers"
326+
value: "basic.json"
327+
- key: "topology_type"
328+
value: "server"
330329

331330
"set topology replica set no auth" :
332331
command: expansions.update
333332
params:
334333
updates:
335334
- key: "orchestration_file"
336-
value: "orchestration_configs/replica_sets/basic.json"
337-
- key: "orchestration_path"
338-
value: "replica_sets"
335+
value: "basic.json"
336+
- key: "topology_type"
337+
value: "replica_set"
339338

340339
"set topology sharded no auth" :
341340
command: expansions.update
342341
params:
343342
updates:
344343
- key: "orchestration_file"
345-
value: "orchestration_configs/sharded_clusters/basic.json"
346-
- key: "orchestration_path"
347-
value: "sharded_clusters"
344+
value: "basic.json"
345+
- key: "topology_type"
346+
value: "sharded_cluster"
348347

349348
"use WiredTiger storage" :
350349
command: expansions.update
351350
params:
352351
updates:
353352
- key: "orchestration_file"
354-
value: "orchestration_configs/servers/wiredtiger.json"
355-
- key: "orchestration_path"
356-
value: "servers"
353+
value: "wiredtiger.json"
354+
- key: "topology_type"
355+
value: "server"
357356

358357
"use MMAPv1 storage" :
359358
command: expansions.update
360359
params:
361360
updates:
362361
- key: "orchestration_file"
363-
value: "orchestration_configs/servers/mmapv1.json"
364-
- key: "orchestration_path"
365-
value: "servers"
362+
value: "mmapv1.json"
363+
- key: "topology_type"
364+
value: "server"
366365

367366
"set version 3.0" :
368367
command: expansions.update
@@ -392,8 +391,8 @@ functions:
392391
script: |
393392
set -o errexit
394393
set -o verbose
395-
export ORCHESTRATION_FILE="${orchestration_file}"
396-
export ORCHESTRATION_PATH="${orchestration_path}"
394+
export ORCHESTRATION_FILE="orchestration_configs/${topology_type}s/${orchestration_file}"
395+
export ORCHESTRATION_URL="http://localhost:8889/v1/${topology_type}s"
397396
${set_username_password}
398397
${start_mongo_orchestration}
399398
${start_topology}

0 commit comments

Comments
 (0)