Files
stoat_role_bot/push-to-gitea.sh
T
Dawnsorrow 0a57be59f4
Build and Push Image / build (push) Has been cancelled
Clean up: remove build-for-nas.sh, update deploy docs and push script
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 21:02:02 -06:00

33 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build and push stoat-role-bot image to your Gitea container registry.
# Image names must be lowercase; owner is lowercased automatically.
#
# One-time: allow HTTP registry (if your Gitea is http://):
# mkdir -p ~/.config/containers
# echo -e '[[registry]]\nlocation = "brassnet.ddns.net:33983"\ninsecure = true' >> ~/.config/containers/registries.conf
# One-time: log in to the registry:
# podman login brassnet.ddns.net:33983
#
# Usage:
# ./push-to-gitea.sh
# # or: ./push-to-gitea.sh brassnet.ddns.net:33983 Dawnsorrow
set -e
cd "$(dirname "$0")"
GITEA_REGISTRY="${1:-brassnet.ddns.net:33983}"
GITEA_OWNER="${2:-Dawnsorrow}"
# OCI image names must be lowercase
OWNER_LOWER="$(echo "$GITEA_OWNER" | tr '[:upper:]' '[:lower:]')"
IMAGE_NAME="stoat-role-bot"
TAG="${3:-latest}"
FULL_IMAGE="${GITEA_REGISTRY}/${OWNER_LOWER}/${IMAGE_NAME}:${TAG}"
echo "Building and pushing to ${FULL_IMAGE} ..."
podman build -t "${FULL_IMAGE}" .
podman push "${FULL_IMAGE}"
echo "Pushed. On your NAS: docker pull ${FULL_IMAGE}"
echo "Then create/update the container to use image: ${FULL_IMAGE}"