#!/bin/bash # Build and push the MCP Manager Docker image. # Clones the source repo (or reuses an existing checkout) and tags/pushes # both :latest and the version tag. set -euo pipefail IMAGE_NAME="${IMAGE_NAME:-git.alexzaw.dev/alexz/mcp-manager}" IMAGE_TAG="${IMAGE_TAG:-1.5.0}" SOURCE_REPO="${SOURCE_REPO:-https://git.alexzaw.dev/alexz/mcp-manager.git}" WORKDIR="${WORKDIR:-/tmp/mcp-manager-build}" echo "==> Preparing source at ${WORKDIR}" if [[ -d "${WORKDIR}/.git" ]]; then git -C "${WORKDIR}" fetch --quiet origin git -C "${WORKDIR}" reset --hard --quiet origin/HEAD else rm -rf "${WORKDIR}" git clone --quiet "${SOURCE_REPO}" "${WORKDIR}" fi echo "==> Building ${IMAGE_NAME}:${IMAGE_TAG} (and :latest)" cd "${WORKDIR}" docker build "$@" \ -t "${IMAGE_NAME}:${IMAGE_TAG}" \ -t "${IMAGE_NAME}:latest" \ . echo "==> Pushing ${IMAGE_NAME}:${IMAGE_TAG}" docker push "${IMAGE_NAME}:${IMAGE_TAG}" echo "==> Pushing ${IMAGE_NAME}:latest" docker push "${IMAGE_NAME}:latest" echo "" echo "Done. To install on Runtipi:" echo " sudo /etc/runtipi/runtipi-cli appstore update" echo " sudo /etc/runtipi/runtipi-cli app install mcp-manager:runtipi"