feat: harden CASAN production install lifecycle
This commit is contained in:
@@ -40,10 +40,17 @@ fi
|
||||
echo "==> installing CASAN core into $TARGET (project=$PROJECT domain=$DOMAIN)"
|
||||
mkdir -p "$TARGET/packages" "$TARGET/bin" "$TARGET/apps/$PROJECT/domain"
|
||||
|
||||
# 1) core harness + CLI
|
||||
RSYNC_EXCLUDES=(--exclude='__pycache__' --exclude='*.pyc' --exclude='.DS_Store' --exclude='*.log')
|
||||
[[ -f "$TARGET/packages/casan-harness/level5/project-registry.json" ]] && RSYNC_EXCLUDES+=(--exclude='level5/project-registry.json')
|
||||
rsync -a "${RSYNC_EXCLUDES[@]}" "$SRC/packages/casan-harness/" "$TARGET/packages/casan-harness/"
|
||||
# 1) production core harness + CLI. Migrate the old Level-5 registry before
|
||||
# cleaning source-only/test content from an existing vendored installation.
|
||||
OLD_REG="$TARGET/packages/casan-harness/level5/project-registry.json"
|
||||
NEW_REG="$TARGET/packages/casan-harness/config/project-registry.json"
|
||||
if [[ -f "$OLD_REG" && ! -f "$NEW_REG" ]]; then
|
||||
mkdir -p "$(dirname "$NEW_REG")"
|
||||
cp "$OLD_REG" "$NEW_REG"
|
||||
fi
|
||||
python3 "$SRC/scripts/copy-runtime.py" \
|
||||
--source-root "$SRC" --destination-root "$TARGET" --component harness --clean \
|
||||
--preserve packages/casan-harness/config/project-registry.json
|
||||
cp "$SRC/bin/casan" "$TARGET/bin/casan"; chmod +x "$TARGET/bin/casan"
|
||||
[[ -f "$SRC/VERSION" ]] && cp "$SRC/VERSION" "$TARGET/VERSION"
|
||||
|
||||
@@ -107,7 +114,7 @@ path.write_text(path.read_text(encoding="utf-8").replace("__PROJECT_ID__", proje
|
||||
PY
|
||||
|
||||
# 5) register in project-registry.json (append if absent)
|
||||
REG="$TARGET/packages/casan-harness/level5/project-registry.json"
|
||||
REG="$NEW_REG"
|
||||
python3 - "$REG" "$PROJECT" "$DOMAIN" <<'PY'
|
||||
import json, os, sys
|
||||
reg, pid, dom = sys.argv[1], sys.argv[2], sys.argv[3]
|
||||
|
||||
Reference in New Issue
Block a user