@@ -21,6 +21,27 @@ DOCKER_COMPOSE="docker-compose --ansi never"
21
21
# don't start these services unless explicitly started
22
22
EXCEPT_SERVICES_DEFAULT=() # array of string e.g. ("a" "b")
23
23
24
+ # Service Aliases
25
+ NODE_NO_STORAGE=' broker-node-no-storage-1 broker-node-no-storage-2'
26
+ NODE_STORAGE=' broker-node-storage-1'
27
+ NODES=" $NODE_NO_STORAGE $NODE_STORAGE "
28
+ TRACKERS=' tracker-1 tracker-2 tracker-3'
29
+
30
+ # swap aliases for full names e.g. trackers = tracker-1 tracker-2 tracker-3
31
+ # feel free to add more, just make sure you don't end up using actual service
32
+ # names as alias names
33
+ expandServiceAliases () {
34
+ local names=$1
35
+ names=" ${names// node-no-storage/ $NODE_NO_STORAGE } "
36
+ names=" ${names// no-storage-nodes/ $NODE_NO_STORAGE } "
37
+ names=" ${names// node-storage/ $NODE_STORAGE } "
38
+ names=" ${names// storage-nodes/ $NODE_STORAGE } "
39
+ names=" ${names// brokers/ $NODES } "
40
+ names=" ${names// nodes/ $NODES } " # brokers/nodes sort of interchangeable
41
+ names=" ${names// trackers/ $TRACKERS } "
42
+ echo " $names "
43
+ }
44
+
24
45
# Execute all commands from the root dir of streamr-docker-dev
25
46
cd " $ROOT_DIR " || exit 1
26
47
@@ -47,6 +68,10 @@ help() {
47
68
" $ORIG_DIRNAME /help_scripts.sh" $SERVICES
48
69
}
49
70
71
+ services () {
72
+ $DOCKER_COMPOSE config --services
73
+ }
74
+
50
75
start () {
51
76
ip_lines=$( ifconfig | grep -c 10.200.10.1)
52
77
if [ " $ip_lines " -eq " 0" ]; then
@@ -234,6 +259,10 @@ while [ $# -gt 0 ]; do # if there are arguments
234
259
shift
235
260
done
236
261
262
+ EXCEPT_SERVICES_DEFAULT=($( expandServiceAliases " ${EXCEPT_SERVICES_DEFAULT[*]} " ) )
263
+ SERVICES=$( expandServiceAliases " $SERVICES " )
264
+ EXCEPT_SERVICES=($( expandServiceAliases " ${EXCEPT_SERVICES[*]} " ) )
265
+
237
266
# Populate COMMANDS_TO_RUN by executing the relevant method
238
267
case $OPERATION in
239
268
" " | help )
@@ -272,6 +301,9 @@ wipe )
272
301
factory-reset )
273
302
factory-reset
274
303
;;
304
+ services )
305
+ services
306
+ ;;
275
307
* )
276
308
help
277
309
echo " ERROR: Invalid command: $OPERATION "
0 commit comments