deployment: Fix installation script pull images

pull/803/head
cruizba 2023-05-22 18:36:09 +02:00
parent 912cdee47f
commit 0a952839c7
2 changed files with 13 additions and 3 deletions

View File

@ -21,7 +21,11 @@ export DOCKER_CLIENT_TIMEOUT=500
pull_images() { pull_images() {
OV_DIRECTORY="$1" OV_DIRECTORY="$1"
pushd "${OV_DIRECTORY}" > /dev/null || fatal_error "Error: can not access to '${OV_DIRECTORY}' folder" pushd "${OV_DIRECTORY}" > /dev/null || fatal_error "Error: can not access to '${OV_DIRECTORY}' folder"
docker-compose pull || fatal_error "Error: can not pull images defined with docker-compose" ALL_IMAGES=$(grep 'image:' docker-compose.yml | awk '{print $2}')
for IMAGE in ${ALL_IMAGES}; do
printf "\n => Pulling image '%s'..." "${IMAGE}"
docker pull "${IMAGE}" || fatal_error "Error while pulling image '${IMAGE}'"
done
popd > /dev/null || fatal_error "Error: can not access to previous folder" popd > /dev/null || fatal_error "Error: can not access to previous folder"
} }

View File

@ -28,12 +28,18 @@ export DOCKER_CLIENT_TIMEOUT=500
pull_images() { pull_images() {
OV_DIRECTORY="$1" OV_DIRECTORY="$1"
pushd "${OV_DIRECTORY}" > /dev/null || fatal_error "Error: can not access to '${OV_DIRECTORY}'"
echo "Pulling images..." echo "Pulling images..."
for image in "${IMAGES_MEDIA_NODE_CONTROLLER[@]}"; do for image in "${IMAGES_MEDIA_NODE_CONTROLLER[@]}"; do
IMAGE_PULL="$(grep "$image" "${OV_DIRECTORY}"/docker-compose.yml | cut -d "=" -f2)" IMAGE_PULL="$(grep "$image" docker-compose.yml | cut -d "=" -f2)"
docker pull "$IMAGE_PULL" || fatal_error "Error: can not pull '${IMAGE_PULL}'" docker pull "$IMAGE_PULL" || fatal_error "Error: can not pull '${IMAGE_PULL}'"
done done
docker-compose -f "${OV_DIRECTORY}"/docker-compose.yml pull || fatal_error "Error: can not pull images defined with docker-compose" DEPLOYMENT_IMAGES=$(grep 'image:' docker-compose.yml | awk '{print $2}')
for IMAGE in ${DEPLOYMENT_IMAGES}; do
printf "\n => Pulling image '%s'..." "${IMAGE}"
docker pull "${IMAGE}" || fatal_error "Error while pulling image '${IMAGE}'"
done
popd > /dev/null || fatal_error "Error: can not access to previous directory"
} }
fatal_error() { fatal_error() {