From: Jeremy Phelps Date: Fri, 11 May 2018 20:18:06 +0000 (-0500) Subject: Add docker clean macro X-Git-Tag: v0.20.0~7^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=dc914933d50cbc1da5602c6975635a6ce5cf4270;p=releng%2Fglobal-jjb.git Add docker clean macro This macro forcibly removes all docker images on build system. Change-Id: I750e235b7de13338d816d2f963f0628b74ef0579 Signed-off-by: Jeremy Phelps --- 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 # ##############