check installed verson of restic in target image

This commit is contained in:
Jonas Forsberg 2023-04-18 10:24:57 +02:00
parent 3a8dbed8db
commit 9bd451d131

View File

@ -2,6 +2,7 @@
set -aeou pipefail set -aeou pipefail
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed" BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
TARGET_REPO="git.rre.nu/jonas/"
PACKAGE_NAME="restic" PACKAGE_NAME="restic"
echo "Pulling latest tumbleweed" echo "Pulling latest tumbleweed"
@ -16,7 +17,7 @@ if [[ "$CURRENT_TUMBLEWEED_TAG" == "$LATEST_TUMBLEWEED_TAG" ]]; then
fi fi
echo "New tumbleweed image exists" echo "New tumbleweed image exists"
CURRENT_VERSION="$(podman run --rm -it ${BASE_IMAGE}:${CURRENT_TUMBLEWEED_TAG} /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" CURRENT_VERSION="$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
echo "current : $CURRENT_VERSION" echo "current : $CURRENT_VERSION"