From dc914933d50cbc1da5602c6975635a6ce5cf4270 Mon Sep 17 00:00:00 2001 From: Jeremy Phelps Date: Fri, 11 May 2018 15:18:06 -0500 Subject: [PATCH] Add docker clean macro This macro forcibly removes all docker images on build system. Change-Id: I750e235b7de13338d816d2f963f0628b74ef0579 Signed-off-by: Jeremy Phelps --- docs/jjb/lf-macros.rst | 5 +++++ jjb/lf-macros.yaml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index 724dad65..558aedd2 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -149,6 +149,11 @@ lf-rtd-verify ReadTheDocs verify script. +lf-infra-provide-docker-cleanup +------------------------------- + +Forcibly removes all of the docker images. + Parameters ========== diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 11a827de..ef5cbd76 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -219,6 +219,16 @@ builder: - shell: !include-raw-escape: ../shell/sigul-install.sh +- builder: + name: lf-infra-provide-docker-cleanup + builders: + - shell: | + #!/bin/bash + set +e # DO NOT cause build failure if docker rmi fails + docker rmi -f $(docker images -a -q) + exit 0 + + ############## # PARAMETERS # ############## -- 2.16.6