Compare commits

..

No commits in common. "main" and "v20230411" have entirely different histories.

3 changed files with 6 additions and 59 deletions

View File

@ -9,7 +9,6 @@ RUN zypper --non-interactive install --no-recommends \
&& zypper clean -a \ && zypper clean -a \
rm /var/log/zypper.log rm /var/log/zypper.log
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
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@ -2,11 +2,9 @@
-include .env -include .env
VERSION=20230926 VERSION=20230411
IMAGENAME=dnsmasq IMAGENAME=dnsmasq
REPO=git.rre.nu/jonas REPO=docker.io/bardak
TITLE=dnsmasq based on openSUSE Tumpleweed
DESC=Image containing dnsmasq, based on openSUSE Tumbleweed
SHELL := /bin/bash SHELL := /bin/bash
@ -24,27 +22,15 @@ require_clean_git:
exit 1; \ exit 1; \
fi fi
build: build:
podman build \ podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
--build-arg VERSION="$(VERSION)" \
--label org.opencontainers.image.source="https://${REPO}/${IMAGENAME}/src/tag/v${VERSION}" \
--label org.opencontainers.image.title="${TITLE}" \
--label org.opencontainers.image.description="${DESC}" \
--label org.opencontainers.image.created="$(shell TZ=UTC date --iso-8601=ns)" \
--label org.opencontainers.image.url="https://${REPO}/-/packages/container/${IMAGENAME}/${VERSION}" \
--label org.opencontainers.image.version="${VERSION}" \
--label org.opencontainers.image.vendor="Jonas Forsberg" \
--tag ${REPO}/${IMAGENAME}:$(VERSION) \
.
clean: clean:
podman image rm ${REPO}/${IMAGENAME}:$(VERSION) podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
release: require_clean_git build release: require_clean_git build
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/sbin/dnsmasq --version)) $(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/sbin/dnsmasq --version))
git tag -a v$(VERSION) -m "dnsmasq version: ${TMP_MESSAGE}" git tag -a v$(VERSION) -m "${TMP_MESSAGE}"
git push origin v$(VERSION) git push origin v$(VERSION)
podman tag ${REPO}/${IMAGENAME}:$(VERSION) ${REPO}/${IMAGENAME}:latest podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
@ echo "Pushing images"
@ podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
@ podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:latest

View File

@ -1,38 +0,0 @@
#!/usr/bin/env bash
set -aeou pipefail
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
TARGET_REPO="git.rre.nu/jonas/"
PACKAGE_NAME="dnsmasq"
git pull
echo "Pulling latest tumbleweed"
podman pull "${BASE_IMAGE}:latest"
CURRENT_TUMBLEWEED_TAG="$(sed -n 's/.*VERSION=\([0-9]\)/\1/p' Makefile)"
LATEST_TUMBLEWEED_TAG="$(podman image inspect --format "{{.Labels}}" registry.opensuse.org/opensuse/tumbleweed:latest | sed -n 's/.*org\.opencontainers\.image\.version:\([0-9]\{8\}\).*/\1/p')"
if [[ "$CURRENT_TUMBLEWEED_TAG" == "$LATEST_TUMBLEWEED_TAG" ]]; then
echo "Already running latest tumbleweed version"
exit 0
fi
echo "New tumbleweed image exists"
if [[ "x" == "x$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper list-updates | grep $PACKAGE_NAME")" ]]; then
echo "No updates for $PACKAGE_NAME"
exit 0
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
sed -i 's/VERSION='"$CURRENT_TUMBLEWEED_TAG"'/VERSION='"$LATEST_TUMBLEWEED_TAG"'/' Makefile
git add Makefile
git commit -m "Updated tumpleweed image to $LATEST_TUMBLEWEED_TAG, $PACKAGE_NAME to $LATEST_VERSION"
git push
echo "build and push new image"
make release