From 69e4de7dcf1f27eb00f30431b8fd93e915084e5d Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Sat, 19 Jul 2025 13:42:15 +0300 Subject: [PATCH] Add latest tag too --- skeleton/podman_push.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 skeleton/podman_push.sh diff --git a/skeleton/podman_push.sh b/skeleton/podman_push.sh new file mode 100755 index 0000000..252b05a --- /dev/null +++ b/skeleton/podman_push.sh @@ -0,0 +1,25 @@ +#!/bin/bash +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +repo="$(basename "${script_dir}")" +tag="${1}" +if [ -z "${tag}" ]; then + git_tag=$(git describe --exact-match --tags) + if [ "${git_tag}" == 'master' ] || [ "${git_tag}" == 'main' ] || [ -z "${git_tag}" ]; then + echo "Change to a different git reference not 'master/main', since it will be used as tag for the container. Or pass a tag name as only parameter." + exit 1 + fi + tag="${git_tag}" +fi +echo "Building '${repo}:${tag}'..." +podman build --tag "${repo}:${tag}" . +echo "Tagging it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..." +podman tag "${repo}:${tag}" "repos.susurrando.com/adelgado/${repo}:${tag}" +echo "Pushing it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..." +podman push "repos.susurrando.com/adelgado/${repo}:${tag}" +tag=latest +echo "Building '${repo}:${tag}'..." +podman build --tag "${repo}:${tag}" . +echo "Tagging it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..." +podman tag "${repo}:${tag}" "repos.susurrando.com/adelgado/${repo}:${tag}" +echo "Pushing it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..." +podman push "repos.susurrando.com/adelgado/${repo}:${tag}"