-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (34 loc) · 1.15 KB
/
docker-pull.yml
File metadata and controls
39 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: docker-pull
on:
schedule:
- cron: 0 0 1 * *
jobs:
docker-pull:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull images
run: |
lastrepo=""
lastseen=""
images=()
for image in $(cat legacy-docker-images.txt); do
images+=("${image}")
done
for module in tools/*; do
if [ -f "$module"/Dockerfile ]; then
images+=($(echo "luslab/nf-modules-${module##*/}:$(cat "$module"/VERSION)"))
fi
done
for image in "${images[@]}"; do
# Parse repository name, we will remove the previous image if different
readarray -d : -t repository <<< "$image"
if [ "${lastseen}" != "" ] && [ "${repository[0]}" != "${lastseen}" ]; then
printf "Removing image ${lastseen} to make room."
docker rmi "${lastrepo}" || docker rmi "${lastseen}"
fi
lastrepo="${repository[0]}"
lastseen="${image}"
printf "Pulling $image\n";
docker pull "${image}"
done