feat: update script
This commit is contained in:
parent
b965ecaf97
commit
97cf13cb09
10
update.sh
Normal file
10
update.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
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
|
||||||
|
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)] | sort_by(.name) | reverse | first | .name')
|
||||||
|
echo "$image:$ver"
|
||||||
|
sed -i 's/image: $image:.*/image: $image:$ver/' docker-compose.yml
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user