Add docker clean macro 13/10613/1
authorJeremy Phelps <jphelps@linuxfoundation.org>
Fri, 11 May 2018 20:18:06 +0000 (15:18 -0500)
committerJeremy Phelps <jphelps@linuxfoundation.org>
Fri, 11 May 2018 20:18:06 +0000 (15:18 -0500)
This macro forcibly removes all docker images on build system.

Change-Id: I750e235b7de13338d816d2f963f0628b74ef0579
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
docs/jjb/lf-macros.rst
jjb/lf-macros.yaml

index 724dad6..558aedd 100644 (file)
@@ -149,6 +149,11 @@ lf-rtd-verify
 
 ReadTheDocs verify script.
 
+lf-infra-provide-docker-cleanup
+-------------------------------
+
+Forcibly removes all of the docker images.
+
 Parameters
 ==========
 
index 11a827d..ef5cbd7 100644 (file)
     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 #
 ##############