Type-aware migration from Fluxer's PostgreSQL fluxer_kv backend to the native Apache Cassandra schema, plus scylla-feature image builds and a full cutover runbook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.5 KiB
Bash
Executable File
38 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the two Fluxer Rust shard services WITH the `scylla` feature, which the
|
|
# public ghcr.io images are compiled WITHOUT. Tag them to match your stack's
|
|
# FLUXER_IMAGE_TAG so the custom images never drift out of sync on upgrades.
|
|
#
|
|
# Usage:
|
|
# ./build-cassandra-images.sh <git-tag> [path-to-fluxer-source]
|
|
# Example:
|
|
# ./build-cassandra-images.sh v1 ~/fluxer-src
|
|
set -euo pipefail
|
|
|
|
TAG="${1:?usage: build-cassandra-images.sh <git-tag> [source-dir]}"
|
|
SRC="${2:-$HOME/fluxer-src}"
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
if [[ ! -f "$SRC/Cargo.toml" ]]; then
|
|
echo "error: $SRC is not a Fluxer source checkout (no Cargo.toml)." >&2
|
|
echo "Clone it first: git clone https://github.com/fluxerapp/fluxer.git $SRC" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo ">> checking out $TAG in $SRC"
|
|
git -C "$SRC" fetch --tags --quiet
|
|
git -C "$SRC" checkout "$TAG"
|
|
|
|
# Drop the scylla-enabled Dockerfiles into the source tree (build context = repo root).
|
|
cp "$HERE/Dockerfile.messages.cassandra" "$SRC/fluxer_messages/Dockerfile.cassandra"
|
|
cp "$HERE/Dockerfile.users.cassandra" "$SRC/fluxer_users/Dockerfile.cassandra"
|
|
|
|
echo ">> building fluxer-messages-cassandra:$TAG"
|
|
docker build -f "$SRC/fluxer_messages/Dockerfile.cassandra" -t "fluxer-messages-cassandra:$TAG" "$SRC"
|
|
|
|
echo ">> building fluxer-users-cassandra:$TAG"
|
|
docker build -f "$SRC/fluxer_users/Dockerfile.cassandra" -t "fluxer-users-cassandra:$TAG" "$SRC"
|
|
|
|
echo ">> done. images:"
|
|
docker images | grep -E "fluxer-(messages|users)-cassandra" | grep "$TAG"
|