blob: d4b90589379a4c56513ab525d62ef41e94d6a3c5 [file] [log] [blame]
Paul Sokolovskydedc4832022-01-17 23:26:30 +03001#!/bin/bash -e
2
3cd dockerfiles/
4
5images_to_update=""
6
7# find out which images haven't had any commits in the last 30 days
8
9for dir in ./*/; do
10 shortdir=$(basename $dir)
11 # Skip toolchain images
12 echo $shortdir|grep -q tcwg && continue
13 # not an image dir
14 [ -x $shortdir/build.sh ]||continue
15 changed=$(git log -1 --oneline --since "1 month" ${shortdir}|wc -l)
16 if [ $changed -eq 1 ]; then
17 echo "new: $shortdir"
18 else
19 echo "nothing new: $shortdir"
20 images_to_update="$images_to_update $shortdir"
21 fi
22done
23
24echo $images_to_update
25
26# trigger builds for every non-updated image over the http api
27for image in $images_to_update
28do
29 arch=$(echo ${image} | cut -f2 -d '-')
30 if [ "$arch" = "aarch64" ]; then
31 arch=arm64
32 fi
33 if [ "$arch" = "amd64" -o "$arch" = "arm64" -o "$arch" = "armhf" ]; then
34 cat > ../docker_${image}_build.txt << EOF
35nodelabel=build-${arch}
36image=${image}
37EOF
38 else
39 echo "unknown arch: $arch in $image"
40 fi
41done
42