Skip to content

Commit

Permalink
Merge "[FAB-3161] Enhance cluster-creation reporting"
Browse files Browse the repository at this point in the history
  • Loading branch information
christo4ferris authored and Gerrit Code Review committed May 5, 2017
2 parents add0af3 + 6663dc0 commit 8c4fa8e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ help:
@cat usage.txt

compose-up: nodes
@echo "Booting docker-compose environment"
$(COMPOSE) up -d ca $(PEERS)
$(DRUN) ./configure.sh $(CHANNEL_NAME) "$(CHANNEL_TXNS)" "$(PEERS)" $(TLS)
@./compose/report-env.sh "$(filter-out cli,$(NODES)")

compose-down:
$(COMPOSE) down
Expand Down
21 changes: 21 additions & 0 deletions examples/cluster/compose/report-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

NODES=$1

getip() {
HOST=$1

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $HOST
}

generate_hosts() {
for NODE in $NODES; do
echo "$(getip $NODE) $NODE"
done
}

echo "========================================================================"
echo "Cluster ready!"
echo "========================================================================"
echo
generate_hosts | sort

0 comments on commit 8c4fa8e

Please sign in to comment.