Files
esign/docker/buildx-and-push.sh
zooqueenandHanzo Dev 15003d6736 The repository, Go module and image are named esign
github.com/hanzoai/esign is the module path and ghcr.io/hanzoai/esign the
image; links that named the old repository, or the upstream image names the
scrub left behind, name hanzoai/esign. The security contact's canonical
address is esign.hanzo.ai.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-16 13:03:51 -07:00

38 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
command -v docker >/dev/null 2>&1 || {
echo "Docker is not running. Please start Docker and try again."
exit 1
}
SCRIPT_DIR="$(readlink -f "$(dirname "$0")")"
MONOREPO_ROOT="$(readlink -f "$SCRIPT_DIR/../")"
# Get the platform from environment variable or set to linux/amd64 if not set
# quote the string to prevent word splitting
if [ -z "$PLATFORM" ]; then
PLATFORM="linux/amd64"
fi
APP_VERSION="$(git name-rev --tags --name-only $(git rev-parse HEAD) | head -n 1 | sed 's/\^0//')"
GIT_SHA="$(git rev-parse HEAD)"
echo "Building docker image for monorepo at $MONOREPO_ROOT"
echo "App version: $APP_VERSION"
echo "Git SHA: $GIT_SHA"
docker buildx build \
-f "$SCRIPT_DIR/Dockerfile" \
--platform=$PLATFORM \
--progress=plain \
--build-arg NEXT_PRIVATE_TELEMETRY_KEY="${NEXT_PRIVATE_TELEMETRY_KEY:-}" \
--build-arg NEXT_PRIVATE_TELEMETRY_HOST="${NEXT_PRIVATE_TELEMETRY_HOST:-}" \
-t "ghcr.io/hanzoai/esign:latest" \
-t "ghcr.io/hanzoai/esign:$GIT_SHA" \
-t "ghcr.io/hanzoai/esign:$APP_VERSION" \
-t "ghcr.io/hanzoai/esign:latest" \
-t "ghcr.io/hanzoai/esign:$GIT_SHA" \
-t "ghcr.io/hanzoai/esign:$APP_VERSION" \
--push \
"$MONOREPO_ROOT"