new python build-deploy chain

This commit is contained in:
Mikkeli Matlock
2026-01-25 00:34:01 +09:00
parent 42e2094635
commit 754cecffd4
8 changed files with 532 additions and 24 deletions

View File

@@ -26,13 +26,14 @@ smart-serow/
│ ├── pubspec.yaml
│ └── elinux/ # Generated by flutter-elinux (gitignored)
├── scripts/
│ ├── build.sh # Cross-compile for ARM64
│ ├── deploy.sh # Push to Pi via rsync
│ ├── deploy_target.json
│ ├── build.py # Cross-compile for ARM64
│ ├── deploy.py # Push to Pi via rsync
│ ├── build-deploy.py # One-click build + deploy
│ ├── deploy_target.sample.json
│ ├── pi_setup.sh # One-time Pi setup
│ └── smartserow-ui.service
│ └── smartserow-ui.service.sample
├── pi_sysroot/ # Pi libraries for cross-linking (gitignored)
└── LICENSE # MIT
└── LICENSE
```
---
@@ -100,33 +101,40 @@ This installs:
## Build & Deploy
### Build (in WSL2)
### One-liner (recommended)
```bash
./scripts/build.sh # Normal build
./scripts/build.sh --clean # Clean CMake cache first
python3 scripts/build-deploy.py # Build, deploy, restart
python3 scripts/build-deploy.py --clean # Clean build first
python3 scripts/build-deploy.py --no-restart # Don't restart service
```
### Individual scripts
```bash
# Build only
python3 scripts/build.py
python3 scripts/build.py --clean
# Deploy only
python3 scripts/deploy.py
python3 scripts/deploy.py --restart
```
Build output: `pi/ui/build/elinux/arm64/release/bundle/`
### Deploy
### Deploy config
Edit `scripts/deploy_target.json`:
Copy and edit `scripts/deploy_target.sample.json` → `scripts/deploy_target.json`:
```json
{
"user": "mikkeli",
"host": "smartserow.local",
"user": "pi",
"host": "raspberrypi.local",
"remote_path": "/opt/smartserow",
"service_name": "smartserow-ui"
}
```
Deploy:
```bash
./scripts/deploy.sh # Just copy files
./scripts/deploy.sh --restart # Copy and restart service
```
### Verify
```bash