Files
sase.tr/scripts/emex-image-upload.sh
Semih Yesilyurt 1e8a049219
Some checks failed
CI / Lint, Typecheck, Test & Build (push) Has been cancelled
feat: EMEX catalog integration — schema, data migration, backend & frontend
Redesign emex_* tables from vehicle-centric to catalog-centric structure with
junction tables (emex_vehicle_group_links, emex_vehicle_part_links). Migrate
92M+ rows from emex DB via postgres_fdw. Add EmexCatalogService for browse
and VIN pre-scraped matching, with Redis caching. Frontend catalog page now
has PL24/Emex tabs with full drill-down routes (brand → vehicle → group → parts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:06:29 +00:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# EMEX Image Upload: webp.7z → MinIO (es bucket)
# Prerequisites: p7zip-full, mc (MinIO client)
# Run from anywhere: bash scripts/emex-image-upload.sh
set -euo pipefail
ARCHIVE="/home/s/webp.7z"
EXTRACT_DIR="/tmp/emex-webp"
MC_ALIAS="local"
BUCKET="es"
echo "=== EMEX Image Upload ==="
echo "Archive: $ARCHIVE ($(du -sh "$ARCHIVE" | cut -f1))"
# 1. Extract
if [ ! -d "$EXTRACT_DIR" ]; then
echo "Extracting archive..."
7z x "$ARCHIVE" -o"$EXTRACT_DIR" -y
else
echo "Extract dir already exists, skipping extraction"
fi
# 2. Create bucket
echo "Creating MinIO bucket: $BUCKET"
mc mb "${MC_ALIAS}/${BUCKET}" 2>/dev/null || true
mc anonymous set download "${MC_ALIAS}/${BUCKET}" 2>/dev/null || true
# 3. Count files
TOTAL=$(find "$EXTRACT_DIR" -name "*.webp" -o -name "*.gif" | wc -l)
echo "Total images to upload: $TOTAL"
# 4. Upload
# Structure in archive: images/CATALOG_CODE/GROUP_ID/FILENAME.ext
# Target: es/CATALOG_CODE/GROUP_ID/FILENAME.ext
echo "Uploading to MinIO..."
mc mirror --overwrite "$EXTRACT_DIR/images/" "${MC_ALIAS}/${BUCKET}/" 2>&1 | tail -5
echo "=== Upload complete ==="
echo "Public URL example: https://storage.sase.tr/es/BMW202501/14788/E36M0AF.webp"
# 5. Verify
echo "Bucket stats:"
mc du "${MC_ALIAS}/${BUCKET}" 2>/dev/null || echo "(mc du not available)"