From 34af6e9b2a1306111033578632e5483ff5e07e66 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Fri, 19 Jul 2019 16:57:54 +0100 Subject: [PATCH] Run image cleanup in parallel Change-type: patch --- automation/build.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/automation/build.sh b/automation/build.sh index 8755f10d..2fba36ba 100755 --- a/automation/build.sh +++ b/automation/build.sh @@ -38,10 +38,6 @@ if [ -z "$ARCH" ] || [ -z "$TAG" ]; then exit 1 fi -function tryRemove() { - docker rmi $1 || true -} - # This is the supervisor image we will produce TARGET_IMAGE=balena/$ARCH-supervisor:$TAG$DEBUG @@ -106,12 +102,11 @@ fi # Wait for any ongoing deploys wait if [ "$CLEANUP" = "true" ]; then - tryRemove $TARGET_IMAGE - - tryRemove $NODE_IMAGE - tryRemove $NODE_BUILD_IMAGE - - tryRemove $TARGET_CACHE - tryRemove $NODE_BUILD_CACHE - tryRemove $NODE_CACHE + docker rmi \ + $TARGET_IMAGE \ + $NODE_IMAGE \ + $NODE_BUILD_IMAGE \ + $TARGET_CACHE \ + $NODE_BUILD_CACHE \ + $NODE_CACHE fi