Updates and enhancements
This commit is contained in:
@@ -90,9 +90,10 @@ for container_path in ${CONTAINER_PATHS[@]}; do
|
|||||||
# search for a pattern of something:something with optional :tag print ^ image name
|
# search for a pattern of something:something with optional :tag print ^ image name
|
||||||
for container_image in $container_images; do
|
for container_image in $container_images; do
|
||||||
debug "$container_stack has image" "$container_image"
|
debug "$container_stack has image" "$container_image"
|
||||||
|
debug "echo $container_image | awk -F/ '{print \$2}' | sed 's/\:.*//'"
|
||||||
container_name="$(echo $container_image | awk -F/ '{print $2}' | sed "s/\:.*//")"
|
container_name="$(echo $container_image | awk -F/ '{print $2}' | sed "s/\:.*//")"
|
||||||
# remove everything after the : ^
|
# remove everything after the : ^
|
||||||
if [[ -z $container_name ]] && [[ -n $(echo $container_image | grep -Ev 'postgres|mariadb') ]]; then
|
if [[ -z $container_name ]]; then #&& [[ -n $(echo $container_image | grep -Ev 'postgres|mariadb') ]]; then
|
||||||
export container_name="$container_image"
|
export container_name="$container_image"
|
||||||
fi
|
fi
|
||||||
debug "$container_image has name" "$container_name"
|
debug "$container_image has name" "$container_name"
|
||||||
@@ -136,8 +137,9 @@ for container_path in ${CONTAINER_PATHS[@]}; do
|
|||||||
ok "$container_name" "is up to date!"
|
ok "$container_name" "is up to date!"
|
||||||
else
|
else
|
||||||
warn "$container_name" "is out of date!"
|
warn "$container_name" "is out of date!"
|
||||||
debug "cat \"$container_path/docker-compose.yml\" | grep -B1 "image: $container_image" | head -1 | sed -e 's/^[ \t]*//' -e 's/://g'"
|
debug "cat \"$container_path/docker-compose.yml\" | grep -B1 \"image: $container_image\" | head -1 | sed -e 's/^[ \t]*//' -e 's/://g' | awk '{print \$NF}')"
|
||||||
service=$(cat "$container_path/docker-compose.yml" | grep -B1 "image: $container_image" | head -1 | sed -e 's/^[ \t]*//' -e 's/://g')
|
service=$(cat "$container_path/docker-compose.yml" | grep -B1 "image: $container_image" | head -1 | sed -e 's/^[ \t]*//' -e 's/://g' | grep -v 'container_name')
|
||||||
|
# get container service name (1 line above image) ^ print service name^ ^ omit tabs and : and ^omit container_name
|
||||||
info "Attempting to update service" "$service"
|
info "Attempting to update service" "$service"
|
||||||
if docker-compose pull $service; then
|
if docker-compose pull $service; then
|
||||||
info "Pulled latest image for" "$container_name"
|
info "Pulled latest image for" "$container_name"
|
||||||
|
|||||||
Reference in New Issue
Block a user