Merge pull request #64 from LF-Certification/release-1.4

Added stop script to remove `fabcar` chaincode containers and images.
I note that the test build failed but it clearly has nothing to do with this change. Fabcar java doesn't seem to be working. This will need to be addressed independently.
This commit is contained in:
Arnaud J Le Hors 2019-11-29 21:32:19 +01:00 committed by GitHub
commit ba63e6533d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

30
fabcar/stopFabric.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
#
# Copyright The Linux Foundation All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
function clearContainers() {
CONTAINER_IDS=$(docker ps -a | awk '($2 ~ /dev-peer.*.fabcar.*/) {print $1}')
if [ -z "$CONTAINER_IDS" -o "$CONTAINER_IDS" == " " ]; then
echo "---- No containers available for deletion ----"
else
docker rm -f $CONTAINER_IDS
fi
}
function removeUnwantedImages() {
DOCKER_IMAGE_IDS=$(docker images | awk '($1 ~ /dev-peer.*.fabcar.*/) {print $3}')
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" == " " ]; then
echo "---- No images available for deletion ----"
else
docker rmi -f $DOCKER_IMAGE_IDS
fi
}
cd ../first-network
echo y | ./byfn.sh down
clearContainers
removeUnwantedImages