summaryrefslogtreecommitdiffstats
path: root/result_collection_api/update/templates/rm_images.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-08-12 11:04:33 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-12 11:04:33 +0000
commit10b9c64ac2013e08cad6cb2c0c961862a5b9b731 (patch)
tree93110daf39e898299f97074ef1b23224d7656b00 /result_collection_api/update/templates/rm_images.sh
parent09b1d2df0b92d83e3f4830a0161dde3743241a08 (diff)
parent5f804d42d7f5c69e24f170cf1afd05068ae0651d (diff)
Merge "support docker build image during updating testapi"
Diffstat (limited to 'result_collection_api/update/templates/rm_images.sh')
-rwxr-xr-xresult_collection_api/update/templates/rm_images.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/result_collection_api/update/templates/rm_images.sh b/result_collection_api/update/templates/rm_images.sh
new file mode 100755
index 0000000..6722573
--- /dev/null
+++ b/result_collection_api/update/templates/rm_images.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+number=`docker images | awk 'NR != 1' | grep testapi | wc -l`
+if [ $number -gt 0 ]; then
+ images=`docker images -a | awk 'NR != 1' | grep testapi | awk '{print $1}'`
+ echo "begin to rm images $images"
+ docker images | awk 'NR != 1' | grep testapi | awk '{print $3}' | xargs docker rmi -f &>/dev/null
+fi