Compare commits

...

7 Commits

Author SHA1 Message Date
Jonas Forsberg
ef7a1fece2 Updated tumpleweed image to 20230926, restic to 0.16.0-1.1 2023-09-29 13:50:50 +02:00
Jonas Forsberg
6196f612ed changed check update logic 2023-09-29 13:50:24 +02:00
Jonas Forsberg
c631b253c5 added git pull 2023-04-29 14:48:37 +02:00
Jonas Forsberg
42fea8c6e1 added TZ env 2023-04-20 13:24:56 +02:00
Jonas Forsberg
f6c1442dbe removed BUILD_TIME variable 2023-04-18 14:14:55 +02:00
Jonas Forsberg
56c02abe56 removed v from image.url 2023-04-18 14:12:46 +02:00
Jonas Forsberg
0124701ca5 fixed label links 2023-04-18 14:09:01 +02:00
3 changed files with 11 additions and 12 deletions

View File

@ -6,6 +6,7 @@ RUN zypper --non-interactive install \
restic \ restic \
&& zypper clean -a && zypper clean -a
ENV TZ="Europe/Stockholm"
COPY entrypoint.sh /usr/local/bin/entrypoint.sh COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh

View File

@ -3,14 +3,12 @@
-include .env -include .env
VERSION=20230416 VERSION=20230926
IMAGENAME=restic IMAGENAME=restic
REPO=git.rre.nu/jonas REPO=git.rre.nu/jonas
TITLE=restic with openSSH based on openSUSE Tumpleweed TITLE=restic with openSSH based on openSUSE Tumpleweed
DESC=Image containing restic & openSSH, based on openSUSE Tumbleweed DESC=Image containing restic & openSSH, based on openSUSE Tumbleweed
BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns)
SHELL := /bin/bash SHELL := /bin/bash
default: build default: build
@ -30,7 +28,7 @@ require_clean_git:
build: build:
podman build \ podman build \
--build-arg VERSION="$(VERSION)" \ --build-arg VERSION="$(VERSION)" \
--label org.opencontainers.image.source="https://${REPO}/${IMAGENAME}/src/tag/${VERSION}" \ --label org.opencontainers.image.source="https://${REPO}/${IMAGENAME}/src/tag/v${VERSION}" \
--label org.opencontainers.image.title="${TITLE}" \ --label org.opencontainers.image.title="${TITLE}" \
--label org.opencontainers.image.description="${DESC}" \ --label org.opencontainers.image.description="${DESC}" \
--label org.opencontainers.image.created="$(shell TZ=UTC date --iso-8601=ns)" \ --label org.opencontainers.image.created="$(shell TZ=UTC date --iso-8601=ns)" \

View File

@ -5,6 +5,8 @@ BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
TARGET_REPO="git.rre.nu/jonas/" TARGET_REPO="git.rre.nu/jonas/"
PACKAGE_NAME="restic" PACKAGE_NAME="restic"
git pull
echo "Pulling latest tumbleweed" echo "Pulling latest tumbleweed"
podman pull "${BASE_IMAGE}:latest" podman pull "${BASE_IMAGE}:latest"
@ -17,16 +19,13 @@ 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 ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" if [[ "x" == "x$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper list-updates | grep $PACKAGE_NAME")" ]]; then
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 "No updates for $PACKAGE_NAME"
echo "current : $CURRENT_VERSION"
echo "latest : $LATEST_VERSION"
if [[ "$CURRENT_VERSION" == "$LATEST_VERSION" ]]; then
echo "No new $PACKAGE_NAME version detected"
exit 0 exit 0
fi fi
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 "updates found : $LATEST_VERSION"
#Updateing Makefile with latest image tag #Updateing Makefile with latest image tag
sed -i 's/VERSION='"$CURRENT_TUMBLEWEED_TAG"'/VERSION='"$LATEST_TUMBLEWEED_TAG"'/' Makefile sed -i 's/VERSION='"$CURRENT_TUMBLEWEED_TAG"'/VERSION='"$LATEST_TUMBLEWEED_TAG"'/' Makefile
@ -37,3 +36,4 @@ git push
echo "build and push new image" echo "build and push new image"
make release make release