forked from olegabu/fabric-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
executable file
·29 lines (23 loc) · 1 KB
/
clean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
source lib/util/util.sh
source lib.sh
localRegistryStarted=`runningDockerContainer docker-registry`
if [ -z "$localRegistryStarted" ] ; then
docker rm -f $(docker ps -aq)
else
echo "localRegistryStarted=$localRegistryStarted"
killContainers=`docker ps -aq | sed -e "s/${localRegistryStarted}/ /"`
echo "killContainers=$killContainers"
docker rm -f ${killContainers}
fi
#TODO [ "${DOCKER_MACHINE_NAME}" == "orderer" ] && EXECUTE_BY_ORDERER=1 runCLIWithComposerOverrides down || runCLIWithComposerOverrides down
docker volume prune -f
docker rmi -f $(docker images -q -f "reference=dev-*")
if [ -z "$DOCKER_HOST" ] ; then
docker-compose -f docker-compose-clean.yaml run --rm cli.clean rm -rf crypto-config/*
else
docker-machine ssh ${DOCKER_MACHINE_NAME} sudo rm -rf crypto-config
docker-machine ssh ${DOCKER_MACHINE_NAME} sudo rm -rf data/
fi
#docker rmi -f $(docker images -q -f "reference=olegabu/fabric-starter-client")
#docker network rm `(docker network ls -q)`