Files
video-downloader/scripts/deploy.sh
T
anthonyandClaude Sonnet 5 d2e491c762 feat: add npm run deploy script for o2switch deployment
Consolidates the manual deploy steps (env copy, install, prisma
generate/migrate deploy, build, pm2 startOrRestart+save) documented
in the README into a single scripts/deploy.sh run over SSH.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-11 14:55:05 +02:00

27 lines
636 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
echo "==> Copie de .env.prod vers .env"
cp .env.prod .env
echo "==> Installation des dependances"
npm install
echo "==> Generation du client Prisma"
npm run db:generate
echo "==> Application des migrations Prisma (production)"
npm run db:migrate:deploy
echo "==> Build de production"
npm run build
echo "==> Demarrage/redemarrage du worker sous pm2"
pm2 startOrRestart ecosystem.config.cjs
pm2 save
echo "==> Deploiement termine."
echo "Pensez a redemarrer l'app Next.js via cPanel > Setup Node.js App si Passenger ne recharge pas automatiquement le nouveau build."