Files
lunarfront-app/deploy/sync-and-deploy.sh
Ryan Moon 5f5ba9e4a2 Build inventory frontend and stock management features
- Full inventory UI: product list with search/filter, product detail with
  tabs (details, units, suppliers, stock receipts, price history)
- Product filters: category, type (serialized/rental/repair), low stock,
  active/inactive — all server-side with URL-synced state
- Product-supplier junction: link products to multiple suppliers with
  preferred flag, joined supplier details in UI
- Stock receipts: record incoming stock with supplier, qty, cost per unit,
  invoice number; auto-increments qty_on_hand for non-serialized products
- Price history tab on product detail page
- categories/all endpoint to avoid pagination limit on dropdown fetches
- categoryId filter on product list endpoint
- Repair parts and additional inventory items in music store seed data
- isDualUseRepair corrected: instruments set to false, strings/parts true
- Product-supplier links and stock receipts in seed data
- Price history seed data simulating cost increases over past year
- 37 API tests covering categories, suppliers, products, units,
  product-suppliers, and stock receipts
- alert-dialog and checkbox UI components
- sync-and-deploy.sh script for rsync + remote deploy
2026-03-30 20:12:07 -05:00

26 lines
800 B
Bash
Executable File

#!/usr/bin/env bash
# LunarFront — Sync local source to EC2 and redeploy
# Usage: bash deploy/sync-and-deploy.sh
set -euo pipefail
EC2_HOST="18.217.233.214"
EC2_USER="ubuntu"
SSH_KEY="$HOME/.ssh/lunarfront-dev.pem"
APP_DIR="/opt/lunarfront"
echo "==> Syncing source to ${EC2_USER}@${EC2_HOST}:${APP_DIR} ..."
rsync -az --delete \
--exclude='.git' \
--exclude='node_modules' \
--exclude='packages/*/node_modules' \
--exclude='packages/admin/dist' \
--exclude='packages/backend/dist' \
--exclude='*.env' \
-e "ssh -i ${SSH_KEY} -o StrictHostKeyChecking=no" \
/home/ryan/pos/ \
"${EC2_USER}@${EC2_HOST}:${APP_DIR}/"
echo "==> Running deploy script on server..."
ssh -i "${SSH_KEY}" -o StrictHostKeyChecking=no "${EC2_USER}@${EC2_HOST}" \
"sudo bash ${APP_DIR}/deploy/deploy.sh"