-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bat
More file actions
119 lines (97 loc) · 3.22 KB
/
deploy.bat
File metadata and controls
119 lines (97 loc) · 3.22 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@echo off
setlocal enabledelayedexpansion
REM CameraClaw Deploy Script (Windows)
REM Installs Node.js dependencies, verifies Docker, and prepares the OpenClaw image.
echo ========================================
echo CameraClaw — Deploy
echo ========================================
echo.
REM ── Node.js Detection ─────────────────
set "NODE_BIN="
where node >nul 2>&1
if %errorlevel% equ 0 (
for /f "tokens=1 delims=v" %%v in ('node --version 2^>nul') do set "NODE_VER=%%v"
for /f "tokens=1 delims=." %%m in ("!NODE_VER!") do set "NODE_MAJOR=%%m"
set "NODE_MAJOR=!NODE_MAJOR:v=!"
if !NODE_MAJOR! GEQ 18 (
set "NODE_BIN=node"
echo [OK] Node.js: node ^(!NODE_VER!^)
)
)
if "!NODE_BIN!"=="" (
echo [ERROR] Node.js ^>= 18 not found
echo Install: https://nodejs.org/
exit /b 1
)
REM ── npm Install ────────────────────────
echo.
echo Installing dependencies...
call npm install --omit=dev
if %errorlevel% neq 0 (
echo [ERROR] npm install failed
exit /b 1
)
echo [OK] Dependencies installed
REM ── Docker Detection ───────────────────
echo.
where docker >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Docker not installed
echo Install Docker Desktop from https://docker.com
exit /b 1
)
docker info >nul 2>&1
if !errorlevel! neq 0 (
echo [ERROR] Docker daemon not running
echo Start Docker Desktop
exit /b 1
)
echo [OK] Docker: available and running
docker compose version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Docker Compose not available
exit /b 1
)
echo [OK] Docker Compose: available
REM ── Prepare OpenClaw Config Directory ──
echo.
set "OPENCLAW_DIR=%USERPROFILE%\.openclaw"
if not exist "!OPENCLAW_DIR!" (
echo Creating OpenClaw config directory: !OPENCLAW_DIR!
mkdir "!OPENCLAW_DIR!"
mkdir "!OPENCLAW_DIR!\workspace"
)
echo [OK] Config dir: !OPENCLAW_DIR!
REM ── Build/Pull OpenClaw Image ──────────
echo.
echo Preparing OpenClaw Docker image...
docker image inspect openclaw:2026.3.12 >nul 2>&1
if !errorlevel! equ 0 (
echo [OK] OpenClaw image: openclaw:2026.3.12 ^(already built^)
) else (
echo Image openclaw:2026.3.12 not found — building locally...
REM Build using the Dockerfile at the skill root
REM Build context is the skill root so COPY scripts/setup-desktop.sh works
docker build -t openclaw:2026.3.12 "%~dp0."
if !errorlevel! neq 0 (
echo [ERROR] Failed to build OpenClaw image
exit /b 1
)
REM Also tag as openclaw:local for backward compatibility
docker tag openclaw:2026.3.12 openclaw:local
docker image inspect openclaw:2026.3.12 >nul 2>&1
if !errorlevel! equ 0 (
echo [OK] OpenClaw image: openclaw:2026.3.12 ^(built locally^)
) else (
echo [ERROR] Failed to build OpenClaw image
exit /b 1
)
)
REM ── Summary ─────────────────────────────
echo.
echo ========================================
echo [OK] CameraClaw ready ^(Docker mode^)
echo Run: node scripts\monitor.js
echo.
echo Deploy complete.
endlocal