Compare commits
No commits in common. "bcc246d3450ac9f49ac2952eff361e385d072efd" and "7f0274c02ecef972aee2b943598cd234fb01a2c9" have entirely different histories.
bcc246d345
...
7f0274c02e
18
Makefile
18
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY: default build clean release require_clean_git
|
||||
.PHONY: default build clean release
|
||||
|
||||
-include .env
|
||||
|
||||
@ -10,18 +10,8 @@ SHELL := /bin/bash
|
||||
|
||||
default: build
|
||||
|
||||
require_clean_git:
|
||||
git update-index -q --ignore-submodules --refresh
|
||||
git diff-files --quiet --ignore-submodules
|
||||
git diff-index --cached --quiet --ignore-submodules HEAD --
|
||||
@status=$$(git status --porcelain); \
|
||||
if test "x$${status}" = x; then \
|
||||
echo "No untracked files detected"; \
|
||||
else \
|
||||
echo "Untracked files detected" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
guard:
|
||||
@ if [ -z "$(git status --porcelain)" ]; then echo "git repo not clean"; exit 1; fi
|
||||
|
||||
build:
|
||||
podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) .
|
||||
@ -29,7 +19,7 @@ build:
|
||||
clean:
|
||||
podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
|
||||
|
||||
release: require_clean_git build
|
||||
release: guard build
|
||||
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/sbin/dnsmasq --version))
|
||||
git tag -a v$(VERSION) -m "${TMP_MESSAGE}"
|
||||
git push origin v$(VERSION)
|
||||
|
34
autobuild.sh
34
autobuild.sh
@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -aeou pipefail
|
||||
|
||||
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
|
||||
|
||||
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"
|
||||
CURRENT_DNSMASQ_VERSION="$(podman run --rm -it ${BASE_IMAGE}:${CURRENT_TUMBLEWEED_TAG} zypper ref > /dev/null && zypper info dnsmasq | sed -n 's/.*Version : \(.*\)$/\1/p')"
|
||||
LATEST_DNSMASQ_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest zypper ref > /dev/null && zypper info dnsmasq | sed -n 's/.*Version : \(.*\)$/\1/p')"
|
||||
|
||||
echo "current : $CURRENT_DNSMASQ_VERSION"
|
||||
echo "latest : $LATEST_DNSMASQ_VERSION"
|
||||
|
||||
if [[ "$CURRENT_DNSMASQ_VERSION" == "$LATEST_DNSMASQ_VERSION" ]]; then
|
||||
echo "No new dnsmasq version detected"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#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 "
|
||||
git push
|
||||
|
||||
echo "build and push new image"
|
||||
|
||||
make release
|
Loading…
Reference in New Issue
Block a user