chore: add docker-prep script + gitignore entries for portable builds

This commit is contained in:
saravanakumardb1 2026-02-28 12:32:28 -08:00
parent 8ef44788e1
commit b124009053
2 changed files with 49 additions and 0 deletions

45
scripts/docker-prep.sh Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
# docker-prep.sh — Pack @bytelyst/* packages as tarballs for Docker/CI builds.
# Delegates to the universal prep-consumer.sh in learning_ai_common_plat.
#
# Usage:
# ./scripts/docker-prep.sh # prep for docker build
# ./scripts/docker-prep.sh --restore # undo package.json changes
#
# Prerequisites:
# cd ../learning_ai_common_plat && pnpm build
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
COMMON_PLAT="${REPO_ROOT}/../learning_ai_common_plat"
PREP_SCRIPT="${COMMON_PLAT}/scripts/prep-consumer.sh"
if [ ! -f "$PREP_SCRIPT" ]; then
echo "❌ Cannot find prep-consumer.sh at $PREP_SCRIPT"
exit 1
fi
# Consumers in this repo that use file: refs to @bytelyst/* packages
CONSUMERS=(web)
MODE="${1:-}"
for consumer in "${CONSUMERS[@]}"; do
TARGET="${REPO_ROOT}/${consumer}"
if [ ! -d "$TARGET" ]; then
echo "⚠️ Skipping ${consumer} — directory not found"
continue
fi
if [[ "$MODE" == "--restore" ]]; then
bash "$PREP_SCRIPT" "$TARGET" --restore
else
bash "$PREP_SCRIPT" "$TARGET"
fi
done
if [[ "$MODE" != "--restore" ]]; then
echo ""
echo "✅ Docker prep complete. Restore with: ./scripts/docker-prep.sh --restore"
fi

4
web/.gitignore vendored
View File

@ -43,3 +43,7 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
# Docker prep (generated by prep-consumer.sh)
.docker-deps/
package.json.bak