Files
Louis King dbd68e9a9f Replace obsolete MQTT broker image with custom build, add connection retry and upgrade docs
- Add custom Dockerfile for meshcore-mqtt-broker (Node 22 Alpine, built from michaelhart/meshcore-mqtt-broker source)
- Add GitHub Actions workflow for weekly multi-arch MQTT broker image builds
- Add local build script (etc/docker/meshcore-mqtt-broker/build.sh)
- Update docker-compose.yml and test compose to use new ghcr.io image
- Add MQTT connection retry logic with exponential backoff to collector subscriber
- Create UPGRADING.md with migration guide for breaking changes
- Update README.md and AGENTS.md for accuracy (Python 3.14, removed commands, fixed MQTT defaults)
- Remove obsolete files (etc/mosquitto.conf, .agentmap.yaml, CLAUDE.md)
2026-04-13 22:27:39 +01:00

46 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
UPSTREAM_REPO="michaelhart/meshcore-mqtt-broker"
UPSTREAM_REF="main"
IMAGE_NAME="ghcr.io/ipnet-mesh/meshcore-mqtt-broker"
PLATFORM="linux/amd64,linux/arm64"
WORKDIR="$(mktemp -d)"
BUILD_ARGS=()
cleanup() { rm -rf "$WORKDIR"; }
trap cleanup EXIT
while [[ $# -gt 0 ]]; do
case "$1" in
--ref)
UPSTREAM_REF="$2"
shift 2
;;
--platform)
PLATFORM="$2"
shift 2
;;
*)
BUILD_ARGS+=("$1")
shift
;;
esac
done
echo "==> Cloning ${UPSTREAM_REPO} @ ${UPSTREAM_REF} into ${WORKDIR}"
git clone --depth 1 --branch "${UPSTREAM_REF}" "https://github.com/${UPSTREAM_REPO}.git" "${WORKDIR}/source"
echo "==> Copying custom Dockerfile"
cp "$(dirname "$0")/Dockerfile" "${WORKDIR}/source/Dockerfile"
echo "==> Building ${IMAGE_NAME}:latest"
docker buildx build \
--platform "${PLATFORM}" \
-t "${IMAGE_NAME}:latest" \
-t "${IMAGE_NAME}:sha-$(git -C "${WORKDIR}/source" rev-parse --short HEAD)" \
"${WORKDIR}/source" \
"${BUILD_ARGS[@]}"
echo "==> Done"