forked from seerr-team/seerr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
72 lines (61 loc) · 1.83 KB
/
Copy pathbuild.bat
File metadata and controls
72 lines (61 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@echo off
setlocal
echo ============================================
echo Seerr - Production Build
echo ============================================
echo.
:: Check for required tools
where node >nul 2>&1 || (echo ERROR: Node.js not found & exit /b 1)
where pnpm >nul 2>&1 || (echo ERROR: pnpm not found & exit /b 1)
where tar >nul 2>&1 || (echo ERROR: tar not found & exit /b 1)
:: Install all dependencies (dev included, needed for build)
echo [1/4] Installing dependencies...
call pnpm install --frozen-lockfile
if %errorlevel% neq 0 (
echo ERROR: Failed to install dependencies.
exit /b 1
)
:: Build
echo [2/4] Building Next.js and server...
call pnpm build
if %errorlevel% neq 0 (
echo ERROR: Build failed.
exit /b 1
)
:: Prepare staging directory
echo [3/4] Preparing production package...
set STAGE=build-output\seerr
if exist build-output rmdir /s /q build-output
mkdir %STAGE%
:: Copy runtime files
copy package.json %STAGE%\
copy pnpm-lock.yaml %STAGE%\
copy next.config.js %STAGE%\
copy next-env.d.ts %STAGE%\
copy seerr-api.yml %STAGE%\
copy install.bat %STAGE%\
copy run.bat %STAGE%\
xcopy .next %STAGE%\.next\ /e /i /q
xcopy dist %STAGE%\dist\ /e /i /q
xcopy public %STAGE%\public\ /e /i /q
mkdir %STAGE%\config
:: Remove Next.js cache to save space
if exist %STAGE%\.next\cache rmdir /s /q %STAGE%\.next\cache
:: Create zip
echo [4/4] Creating zip...
set ZIP_NAME=seerr-build.zip
if exist %ZIP_NAME% del %ZIP_NAME%
tar -a -cf %ZIP_NAME% -C build-output seerr
:: Cleanup staging
rmdir /s /q build-output
echo.
echo ============================================
echo Build complete: %ZIP_NAME%
echo ============================================
echo.
echo To deploy:
echo 1. Extract %ZIP_NAME% on the target machine
echo 2. Run install.bat to install production dependencies
echo 3. Run run.bat to start the server
echo.
pause