blob: 08562da3f7d98b22c5b34fb75f820248bf244db0 [file] [log] [blame]
Riku Voipio6295df52020-10-20 15:46:46 +03001#!/bin/bash -e
2
Paul Sokolovsky8d6795c2024-02-07 02:10:20 +07003# Update existing images on the host
Riku Voipio6295df52020-10-20 15:46:46 +03004for image in $(docker images|grep trustedfirmware|grep -v none|awk '{ print $1":"$2}');
5do
6 echo update: $image:
7 if ! docker pull $image
8 then
9 echo could not fetch image from dockerhub, delete
10 docker rmi $image||true
11 fi
12done
13
Paul Sokolovsky8d6795c2024-02-07 02:10:20 +070014# Potentially install new images added to Jenkins Yet Another Docker Plugin config
15rm -rf /tmp/ci-yadp-builder-$$
16git clone https://git.trustedfirmware.org/ci/ci-yadp-builder.git /tmp/ci-yadp-builder-$$
17
18for image in $(cat /tmp/ci-yadp-builder-$$/docker_templates_amd64.yml | yq '.[] .docker_image_name' | grep 'trustedfirmware/');
19do
20 echo pull: $image:
21 docker pull $image || true
22done
23
Riku Voipio6295df52020-10-20 15:46:46 +030024echo cleaning up
Kelley Spoone49805f2024-01-22 10:32:30 -060025# cleans up non-running containers, unused networks
26docker container prune -f
27# clean up *dangling* images
28docker image prune -f