blob: 08562da3f7d98b22c5b34fb75f820248bf244db0 [file] [log] [blame]
#!/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:
if ! docker pull $image
then
echo could not fetch image from dockerhub, delete
docker rmi $image||true
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
# clean up *dangling* images
docker image prune -f