09e3b6ca66
Build and Push Image / build (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
939 B
Bash
Executable File
32 lines
939 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Manual push of stoat-role-bot image to your Gitea container registry.
|
|
# Usage:
|
|
# export GITEA_REGISTRY=mygitea.example.com
|
|
# export GITEA_OWNER=myuser
|
|
# ./push-to-gitea.sh
|
|
# Or: ./push-to-gitea.sh mygitea.example.com myuser
|
|
|
|
set -e
|
|
cd "$(dirname "$0")"
|
|
|
|
GITEA_REGISTRY="${1:-$GITEA_REGISTRY}"
|
|
GITEA_OWNER="${2:-$GITEA_OWNER}"
|
|
IMAGE_NAME="stoat-role-bot"
|
|
TAG="${3:-latest}"
|
|
|
|
if [ -z "$GITEA_REGISTRY" ] || [ -z "$GITEA_OWNER" ]; then
|
|
echo "Usage: GITEA_REGISTRY=host GITEA_OWNER=username $0"
|
|
echo " or: $0 <gitea-host> <owner-username> [tag]"
|
|
echo "Example: $0 gitea.example.com john"
|
|
exit 1
|
|
fi
|
|
|
|
FULL_IMAGE="${GITEA_REGISTRY}/${GITEA_OWNER}/${IMAGE_NAME}:${TAG}"
|
|
echo "Building and pushing to ${FULL_IMAGE} ..."
|
|
|
|
podman build -t "${FULL_IMAGE}" .
|
|
podman push "${FULL_IMAGE}"
|
|
|
|
echo "Pushed. On your NAS run: docker pull ${FULL_IMAGE}"
|
|
echo "Then create/update the container to use image: ${FULL_IMAGE}"
|