ci-dockerslaves-cleanup: update and cleanup docker builders

Pull latest docker images. implments LSS-1707 and LSS-1471

Change-Id: I50e3f20cc53da4edb2bfe5180c74188e1123308e
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
diff --git a/ci-dockerfiles-deployment/cleanup-update.sh b/ci-dockerfiles-deployment/cleanup-update.sh
new file mode 100644
index 0000000..a0a3abe
--- /dev/null
+++ b/ci-dockerfiles-deployment/cleanup-update.sh
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+
+for image in $(docker images|grep trustedfirmware|grep -v none|awk '{ print $1":"$2}');
+do
+    echo update: $image:
+    if ! docker pull $image
+    then
+        echo could not fetch image from dockerhub, delete
+        docker rmi $image||true
+    fi
+done
+
+echo cleaning up
+docker system prune -f
diff --git a/ci-dockerslaves-cleanup.yaml b/ci-dockerslaves-cleanup.yaml
new file mode 100644
index 0000000..2ed6a45
--- /dev/null
+++ b/ci-dockerslaves-cleanup.yaml
@@ -0,0 +1,43 @@
+- job:
+    name: ci-dockerslaves-cleanup
+    project-type: matrix
+    defaults: global
+    properties:
+        - authorization:
+            anonymous:
+                - job-discover
+            linaro:
+                - job-read
+                - job-extended-read
+        - build-discarder:
+            days-to-keep: 20
+            num-to-keep: 50
+        - build-blocker:
+            use-build-blocker: true
+            blocking-jobs:
+              - "ci-docker*"
+            block-level: 'NODE'
+            queue-scanning: 'ALL'
+    disabled: false
+    node: master
+    concurrent: false
+    display-name: 'CI docker cleanup and image update'
+    triggers:
+        - timed : '@daily'
+    axes:
+        - axis:
+            type: slave
+            name: nodes
+            values:
+                - x86_64-TF-01
+                - x86_64-TF-02
+    execution-strategy:
+        sequential: false
+    wrappers:
+        - timestamps
+    builders:
+        - shell:
+            !include-raw: ci-dockerfiles-deployment/cleanup-update.sh
+    publishers:
+        - email:
+            recipients: linaro-infrastructure-errors@lists.linaro.org