-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-vercel.bat
More file actions
57 lines (47 loc) · 1.47 KB
/
Copy pathdeploy-vercel.bat
File metadata and controls
57 lines (47 loc) · 1.47 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
@echo off
setlocal enabledelayedexpansion
:: ==============================================================================
:: deploy-vercel.bat
:: Deploys the ProCase web application to Vercel production.
::
:: Usage:
:: deploy-vercel.bat (Deploy to production)
:: deploy-vercel.bat --preview (Deploy preview build)
:: ==============================================================================
cd /d "%~dp0"
echo =================================================
echo ProCase Vercel Deployment
echo =================================================
echo.
if not exist "node_modules" (
echo ==^> node_modules not found. Running npm install...
call npm install
if errorlevel 1 goto :error
)
echo ==^> Verifying web bundle build (VERCEL=1)...
set VERCEL=1
call npm run build
if errorlevel 1 goto :error
set "TARGET_FLAG=--prod"
if /i "%~1"=="--preview" set "TARGET_FLAG="
if defined TARGET_FLAG (
echo.
echo ==^> Deploying to Vercel ^(Production^)...
call npx vercel deploy --prod --yes %*
) else (
echo.
echo ==^> Deploying to Vercel ^(Preview^)...
call npx vercel deploy --yes %*
)
if errorlevel 1 goto :error
echo.
echo =================================================
echo Vercel deployment completed successfully!
echo =================================================
exit /b 0
:error
echo.
echo =================================================
echo [ERROR] Vercel deployment failed!
echo =================================================
exit /b 1