Files
Nodecast/scripts/docker-build-push.sh
blomios d64e5b6518 feat(deploy): publish Nodecast and Laya images together (#31)
Update the Docker build/push helper to build and push both application and Laya images, and document the configurable image targets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-06 21:18:24 +02:00

40 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REGISTRY=${REGISTRY:-gitea.anthonybouteiller.ovh}
OWNER=${OWNER:-blomios}
IMAGE_NAME=${IMAGE_NAME:-nodecast-tv}
LAYA_IMAGE_NAME=${LAYA_IMAGE_NAME:-nodecast-tv-laya}
TAG=${TAG:-latest}
IMAGE="${REGISTRY}/${OWNER}/${IMAGE_NAME}:${TAG}"
LAYA_IMAGE="${REGISTRY}/${OWNER}/${LAYA_IMAGE_NAME}:${TAG}"
push_image=true
if [[ "${1:-}" == "--no-push" ]]; then
push_image=false
elif [[ $# -gt 0 ]]; then
echo "Usage: $0 [--no-push]" >&2
exit 2
fi
if ! command -v docker >/dev/null 2>&1; then
echo "Error: docker is required but was not found in PATH." >&2
exit 1
fi
repo_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
echo "Target Nodecast image: ${IMAGE}"
echo "Target Laya image: ${LAYA_IMAGE}"
docker build --file "${repo_dir}/Dockerfile" --tag "${IMAGE}" "${repo_dir}"
docker build --file "${repo_dir}/Dockerfile.laya" --tag "${LAYA_IMAGE}" "${repo_dir}"
if [[ "${DRY_RUN:-false}" == "true" || "${push_image}" == "false" ]]; then
echo "Push skipped."
exit 0
fi
docker push "${IMAGE}"
docker push "${LAYA_IMAGE}"