4 Commits

Author SHA1 Message Date
25c138ec37 first few OCI lables 2023-04-18 13:29:16 +02:00
9bd451d131 check installed verson of restic in target image 2023-04-18 10:24:57 +02:00
Jonas Forsberg
3a8dbed8db changed to private image repo 2023-04-17 19:43:44 +02:00
Jonas Forsberg
52d867d7ae more verbose tag message 2023-04-17 14:21:03 +02:00
3 changed files with 20 additions and 5 deletions

View File

@@ -1,12 +1,20 @@
ARG VERSION
ARG BUILD_TIME
FROM registry.opensuse.org/opensuse/tumbleweed:${VERSION}
LABEL org.opencontainers.image.description=Image containing restic & openSSH, based on openSUSE Tumbleweed
LABEL org.opencontainers.image.source=https://git.rre.nu/jonas/restic/src/tag/${VERSION}
LABEL org.opencontainers.image.title=restic with openSSH based on openSUSE Tumpleweed
LABEL org.opencontainers.image.url=https://git.rre.nu/jonas/-/packages/container/restic/${VERSION}
LABEL org.opencontainers.image.created=${BUILD_TIME}
RUN zypper --non-interactive install \
openssh-clients \
restic \
&& zypper clean -a
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -5,7 +5,9 @@
VERSION=20230411
IMAGENAME=restic
REPO=docker.io/bardak
REPO=git.rre.nu/jonas
BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns)
SHELL := /bin/bash
@@ -24,14 +26,18 @@ require_clean_git:
default: build
build:
podman build --build-arg VERSION=$(VERSION) --tag docker.io/bardak/restic:$(VERSION) .
podman build \
--build-arg VERSION=$(VERSION) \
--build-arg BUILD_TIME=${BUILD_TIME} \
--tag docker.io/bardak/restic:$(VERSION) \
.
clean:
podman image rm docker.io/bardak/restic:$(VERSION)
release: require_clean_git build
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/bin/restic --version))
git tag -a v$(VERSION) -m "${TMP_MESSAGE}"
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/bin/restic --version))
git tag -a v$(VERSION) -m "restic version: ${TMP_MESSAGE}"
git push origin v$(VERSION)
podman tag ${REPO}/${IMAGENAME}:$(VERSION) ${REPO}/${IMAGENAME}:latest
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)

View File

@@ -2,6 +2,7 @@
set -aeou pipefail
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
TARGET_REPO="git.rre.nu/jonas/"
PACKAGE_NAME="restic"
echo "Pulling latest tumbleweed"
@@ -16,7 +17,7 @@ if [[ "$CURRENT_TUMBLEWEED_TAG" == "$LATEST_TUMBLEWEED_TAG" ]]; then
fi
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'")"
echo "current : $CURRENT_VERSION"