cleanup-update.sh: Pick up new docker images from ci-yadp-builder config

This solves issue that newly added images were never pulled automatically
and had to be deployed on each worker host manually. Now, as long as they
are added to docker plygin config, they will be pulled in.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ic549785aa1f6d4977f38ae1207fd6fa262c0c854
diff --git a/ci-dockerfiles-deployment/cleanup-update.sh b/ci-dockerfiles-deployment/cleanup-update.sh
index 53d5210..08562da 100644
--- a/ci-dockerfiles-deployment/cleanup-update.sh
+++ b/ci-dockerfiles-deployment/cleanup-update.sh
@@ -1,5 +1,6 @@
 #!/bin/bash -e
 
+# Update existing images on the host
 for image in $(docker images|grep trustedfirmware|grep -v none|awk '{ print $1":"$2}');
 do
     echo update: $image:
@@ -10,6 +11,16 @@
     fi
 done
 
+# Potentially install new images added to Jenkins Yet Another Docker Plugin config
+rm -rf /tmp/ci-yadp-builder-$$
+git clone https://git.trustedfirmware.org/ci/ci-yadp-builder.git /tmp/ci-yadp-builder-$$
+
+for image in $(cat /tmp/ci-yadp-builder-$$/docker_templates_amd64.yml | yq '.[] .docker_image_name' | grep 'trustedfirmware/');
+do
+    echo pull: $image:
+    docker pull $image || true
+done
+
 echo cleaning up
 # cleans up non-running containers, unused networks
 docker container prune -f