2023-05-02 08:46:54 +02:00
|
|
|
#!/bin/sh
|
2023-03-05 08:58:20 +01:00
|
|
|
images=$(grep 'image:' docker-compose.yml | grep -v '#' | sed 's/^ *//' | cut -d ' ' -f2 | cut -d ':' -f1)
|
|
|
|
for image in $images
|
|
|
|
do
|
|
|
|
if [[ $image != gcr* ]]; then
|
2023-10-03 07:50:47 +02:00
|
|
|
ver=$(curl -s https://registry.hub.docker.com/v2/repositories/${image}/tags | jq -r '[.results[] | select(.name | contains("ubuntu") | not) | select(.name | contains("main") | not ) | select(.name | contains("master") | not ) | select(.name | contains("latest") | not) | select(.name | contains("rc") | not) | select(.name | contains("-") | not) | select(.name | contains("."))] | sort_by(.name|sub("^v";"")|split(".")|map(tonumber)) | reverse | first | .name')
|
2023-03-05 08:58:20 +01:00
|
|
|
echo "$image:$ver"
|
2023-04-02 08:07:29 +02:00
|
|
|
sed -i "s#image: $image:.*#image: $image:$ver#" docker-compose.yml
|
2023-03-05 08:58:20 +01:00
|
|
|
fi
|
|
|
|
done
|
2023-04-02 08:07:29 +02:00
|
|
|
git --no-pager diff
|