Some checks failed
Docker build and push / build-and-push (push) Has been cancelled
- Add .gitea/workflows/docker-build-push.yaml: build api/admin/upload on push to main - Build script: build for linux/amd64 by default (PLATFORM), doc PLATFORM=linux/arm64 - Deploy README: Option A Gitea Actions, Option B manual; proxy timeout troubleshooting Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.7 KiB
Bash
Executable File
46 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Build and push event-uploader Docker images to Gitea container registry.
|
|
# One-time: docker login 10.0.10.205:3000 (username: bert.hausmans, password: token or password).
|
|
# Usage: ./scripts/docker-build-push.sh [VERSION]
|
|
# VERSION defaults to "latest" (or git describe --tags --always if available).
|
|
# Set PLATFORM=linux/arm64 if your Dockge server is ARM (e.g. Raspberry Pi).
|
|
# Run from project root.
|
|
|
|
set -e
|
|
REGISTRY="${REGISTRY:-10.0.10.205:3000}"
|
|
OWNER="${OWNER:-bert.hausmans}"
|
|
|
|
cd "$(dirname "$0")/.."
|
|
ROOT="$(pwd)"
|
|
|
|
if [ -n "$1" ]; then
|
|
VERSION="$1"
|
|
else
|
|
VERSION=$(git describe --tags --always 2>/dev/null || echo "latest")
|
|
fi
|
|
|
|
# Build for linux/amd64 so images run on typical Dockge servers (avoid "no matching manifest" on ARM-built images)
|
|
PLATFORM="${PLATFORM:-linux/amd64}"
|
|
echo "Building and pushing images with tag: $VERSION (platform: $PLATFORM)"
|
|
echo "Registry: $REGISTRY, Owner: $OWNER"
|
|
echo ""
|
|
|
|
for name in api admin upload; do
|
|
docker build --platform "$PLATFORM" -t "$REGISTRY/$OWNER/event-uploader-$name:$VERSION" "$ROOT/$name"
|
|
docker push "$REGISTRY/$OWNER/event-uploader-$name:$VERSION"
|
|
if [ "$VERSION" != "latest" ]; then
|
|
docker tag "$REGISTRY/$OWNER/event-uploader-$name:$VERSION" "$REGISTRY/$OWNER/event-uploader-$name:latest"
|
|
docker push "$REGISTRY/$OWNER/event-uploader-$name:latest"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "Done. Images pushed:"
|
|
echo " $REGISTRY/$OWNER/event-uploader-api:$VERSION"
|
|
echo " $REGISTRY/$OWNER/event-uploader-admin:$VERSION"
|
|
echo " $REGISTRY/$OWNER/event-uploader-upload:$VERSION"
|
|
if [ "$VERSION" != "latest" ]; then
|
|
echo " (also tagged and pushed as :latest)"
|
|
fi
|
|
echo "On Dockge: set TAG=$VERSION (or TAG=latest) in stack .env, then Pull and Redeploy."
|