1 Commits

Author SHA1 Message Date
user
9ece83bac0 ci: Simplify deploy script to pure POSIX sh
All checks were successful
Lint & Build / C/C++ Static Analysis (push) Successful in 35s
Lint & Build / Security Flaw Analysis (push) Successful in 18s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m17s
Lint & Build / Deploy to ESP Fleet (push) Successful in 3m28s
2026-02-05 13:28:28 +01:00

View File

@@ -74,18 +74,11 @@ jobs:
idf.py build
- name: Deploy via OTA
shell: bash
run: |
# Sensor IPs (update if DHCP changes)
SENSOR_NAMES="muddy-storm amber-maple hollow-acorn"
SENSOR_IPS="192.168.129.29 192.168.129.30 192.168.129.31"
PORT=8070
# Get host IP - try multiple methods
HOST_IP=$(ip route get 1 2>/dev/null | awk '{print $7; exit}')
if [ -z "$HOST_IP" ]; then
HOST_IP=$(hostname -I | awk '{print $1}')
fi
# Get host IP
HOST_IP=$(hostname -I | awk '{print $1}')
echo "Host IP: $HOST_IP"
# Start HTTP server in background
@@ -94,20 +87,20 @@ jobs:
HTTP_PID=$!
sleep 2
# Deploy to each sensor
set -- $SENSOR_IPS
for sensor in $SENSOR_NAMES; do
SENSOR_IP="$1"
shift
echo "=== Deploying to $sensor ($SENSOR_IP) ==="
# Deploy to muddy-storm
echo "=== Deploying to muddy-storm (192.168.129.29) ==="
echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.29 5501 || true
sleep 30
# Send OTA command via UDP
echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 $SENSOR_IP 5501
echo "OTA command sent to $sensor"
# Deploy to amber-maple
echo "=== Deploying to amber-maple (192.168.129.30) ==="
echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.30 5501 || true
sleep 30
# Wait for device to download and reboot
sleep 30
done
# Deploy to hollow-acorn
echo "=== Deploying to hollow-acorn (192.168.129.31) ==="
echo "OTA http://${HOST_IP}:${PORT}/csi_recv_router.bin" | nc -u -w 2 192.168.129.31 5501 || true
sleep 30
# Cleanup
kill $HTTP_PID 2>/dev/null || true