This commit is contained in:
2026-08-21 17:39:11 +08:00
parent 4d434c9c67
commit b20e566a65
2 changed files with 17 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/deploy.env"
SSH_OPTS=(-o "StrictHostKeyChecking=accept-new" -p "${DEPLOY_PORT:-22}")
if [[ -n "${DEPLOY_SSH_KEY:-}" ]]; then
SSH_OPTS+=(-i "$DEPLOY_SSH_KEY")
fi
ssh "${SSH_OPTS[@]}" "${DEPLOY_USER}@${DEPLOY_HOST}" bash -s <<'REMOTE'
set -euo pipefail
cd /opt/dukang/server/dukang-api
echo "==> backfill default SKUs"
node scripts/with-api-env.cjs npx ts-node --transpile-only prisma/backfill-product-skus.ts
echo "==> rewrite SKU codes to DK"
node scripts/with-api-env.cjs npx ts-node --transpile-only prisma/rewrite-sku-codes-dk.ts
REMOTE
Binary file not shown.

After

Width:  |  Height:  |  Size: 921 KiB