From 1cd059e534aebda20d00802baaa9bb83fae05b68 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Mon, 21 May 2018 16:46:17 -0400 Subject: [PATCH] FAB-8612 Cleanup eyfn/byfn with --remove-orphans There are currently multiple docker-compose downs going on in the first-network samples. These are in an attempt to catch different configurations of the same compose network. The flag --remove-orphans was created to allow tearing down components in a composition even when there is a mismatch in the compose definition, so this cleans the down scripts up a bit. Change-Id: Ied6a06e2ebc21053993e2a6b39b6fbd7fffdfe02 Signed-off-by: Jason Yellick --- first-network/byfn.sh | 3 +-- first-network/eyfn.sh | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/first-network/byfn.sh b/first-network/byfn.sh index 4c582e4d69..6cf2079329 100755 --- a/first-network/byfn.sh +++ b/first-network/byfn.sh @@ -235,8 +235,7 @@ function upgradeNetwork () { # Tear down running network function networkDown () { # stop org3 containers also in addition to org1 and org2, in case we were running sample to add org3 - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_ORG3 down --volumes - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 down --volumes + docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_ORG3 down --volumes --remove-orphans # Don't remove the generated artifacts -- note, the ledgers are always removed if [ "$MODE" != "restart" ]; then diff --git a/first-network/eyfn.sh b/first-network/eyfn.sh index 7447388864..cee408b829 100755 --- a/first-network/eyfn.sh +++ b/first-network/eyfn.sh @@ -136,8 +136,7 @@ function networkUp () { # Tear down running network function networkDown () { - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 down --volumes - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes + docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes --remove-orphans # Don't remove containers, images, etc if restarting if [ "$MODE" != "restart" ]; then #Cleanup the chaincode containers @@ -149,10 +148,6 @@ function networkDown () { # remove the docker-compose yaml file that was customized to the example rm -f docker-compose-e2e.yaml fi - - # For some black-magic reason the first docker-compose down does not actually cleanup the volumes - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 down --volumes - docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes } # Use the CLI container to create the configuration transaction needed to add