monitoring/update.sh

12 lines
676 B
Bash
Raw Normal View History

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-09-23 07:31:56 +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("."))] | 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