mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
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:
commit
ba63e6533d
1 changed files with 30 additions and 0 deletions
30
fabcar/stopFabric.sh
Executable file
30
fabcar/stopFabric.sh
Executable 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
|
||||
Loading…
Reference in a new issue