File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- set -e
4-
53TF_TAG=" tinyFaaS"
64TMP_DIR=" tmp"
75
86# remove old containers, networks and images
97containers=$( docker ps -a -q --filter label=$TF_TAG )
108
119if [ -n " $containers " ]; then
12- docker stop " $containers " > /dev/null
13- docker rm " $containers " > /dev/null
10+ for container in $containers ; do
11+ docker stop " $container " > /dev/null || echo " Failed to stop container $container ! Please stop it manually..."
12+ docker rm " $container " > /dev/null || echo " Failed to remove container $container ! Please remove it manually..."
13+ done
1414else
1515 echo " No old containers to remove. Skipping..."
1616fi
1717
1818networks=$( docker network ls -q --filter label=$TF_TAG )
1919
2020if [ -n " $networks " ]; then
21- docker network rm " $networks " > /dev/null
21+ for network in $networks ; do
22+ docker network rm " $network " > /dev/null || echo " Failed to remove network $network ! Please remove it manually..."
23+ done
2224else
2325 echo " No old networks to remove. Skipping..."
2426fi
@@ -27,17 +29,15 @@ images=$(docker image ls -q --filter label=$TF_TAG)
2729
2830if [ -n " $images " ]; then
2931 for image in $images ; do
30- docker image rm " $image " > /dev/null
32+ docker image rm " $image " > /dev/null || echo " Failed to remove image $image ! Please remove it manually... "
3133 done
3234else
3335 echo " No old images to remove. Skipping..."
3436fi
3537
3638# remove tmp directory
3739if [ -d " $TMP_DIR " ]; then
38- rm -rf " $TMP_DIR "
40+ rm -rf " $TMP_DIR " > /dev/null || echo " Failed to remove directory $TMP_DIR ! Please remove it manually... "
3941else
4042 echo " No tmp directory to remove. Skipping..."
4143fi
42-
43- set +e
You can’t perform that action at this time.
0 commit comments