ci: Serve firmware from runner for OTA deployment
Some checks failed
Lint & Build / C/C++ Static Analysis (push) Failing after 37s
Lint & Build / Security Flaw Analysis (push) Successful in 21s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 6s
Lint & Build / Build Firmware (push) Successful in 2m12s
Lint & Build / Deploy to ESP Fleet (push) Successful in 4m19s
Some checks failed
Lint & Build / C/C++ Static Analysis (push) Failing after 37s
Lint & Build / Security Flaw Analysis (push) Successful in 21s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 6s
Lint & Build / Build Firmware (push) Successful in 2m12s
Lint & Build / Deploy to ESP Fleet (push) Successful in 4m19s
Instead of having ESP devices download from Gitea (TLS cert issues), the runner now serves firmware via local HTTP server and triggers OTA with the local URL.
This commit is contained in:
@@ -106,30 +106,39 @@ jobs:
|
|||||||
-F "attachment=@get-started/csi_recv_router/build/csi_recv_router.bin" \
|
-F "attachment=@get-started/csi_recv_router/build/csi_recv_router.bin" \
|
||||||
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=csi_recv_router.bin"
|
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=csi_recv_router.bin"
|
||||||
|
|
||||||
# Store release URL for OTA
|
|
||||||
FIRMWARE_URL="https://git.mymx.me/$REPO/releases/download/$TAG/csi_recv_router.bin"
|
|
||||||
echo "Firmware URL: $FIRMWARE_URL"
|
|
||||||
echo "$FIRMWARE_URL" > /tmp/firmware_url.txt
|
|
||||||
|
|
||||||
- name: Deploy via OTA
|
- name: Deploy via OTA
|
||||||
run: |
|
run: |
|
||||||
FIRMWARE_URL=$(cat /tmp/firmware_url.txt)
|
SENSORS="muddy-storm:192.168.129.29 amber-maple:192.168.129.30 hollow-acorn:192.168.129.31"
|
||||||
echo "Using firmware URL: $FIRMWARE_URL"
|
FIRMWARE_PATH="get-started/csi_recv_router/build/csi_recv_router.bin"
|
||||||
|
OTA_PORT=8899
|
||||||
|
|
||||||
# Deploy to muddy-storm
|
# Get runner IP (first non-loopback interface)
|
||||||
echo "=== Deploying to muddy-storm (192.168.129.29) ==="
|
RUNNER_IP=$(hostname -I | awk '{print $1}')
|
||||||
echo "OTA $FIRMWARE_URL" | nc -u -w 2 192.168.129.29 5501 || true
|
echo "Runner IP: $RUNNER_IP"
|
||||||
sleep 30
|
|
||||||
|
|
||||||
# Deploy to amber-maple
|
# Start HTTP server to serve firmware
|
||||||
echo "=== Deploying to amber-maple (192.168.129.30) ==="
|
cd get-started/csi_recv_router/build
|
||||||
echo "OTA $FIRMWARE_URL" | nc -u -w 2 192.168.129.30 5501 || true
|
python3 -m http.server $OTA_PORT &
|
||||||
sleep 30
|
HTTP_PID=$!
|
||||||
|
sleep 2
|
||||||
|
|
||||||
# Deploy to hollow-acorn
|
FIRMWARE_URL="http://${RUNNER_IP}:${OTA_PORT}/csi_recv_router.bin"
|
||||||
echo "=== Deploying to hollow-acorn (192.168.129.31) ==="
|
echo "Firmware URL: $FIRMWARE_URL"
|
||||||
echo "OTA $FIRMWARE_URL" | nc -u -w 2 192.168.129.31 5501 || true
|
|
||||||
sleep 30
|
# Verify server is running
|
||||||
|
curl -sI "http://localhost:${OTA_PORT}/csi_recv_router.bin" | head -1
|
||||||
|
|
||||||
|
# Deploy to each sensor
|
||||||
|
for entry in $SENSORS; do
|
||||||
|
NAME="${entry%%:*}"
|
||||||
|
IP="${entry##*:}"
|
||||||
|
echo "=== Deploying to $NAME ($IP) ==="
|
||||||
|
echo "OTA $FIRMWARE_URL" | nc -u -w 2 "$IP" 5501 || true
|
||||||
|
sleep 45
|
||||||
|
done
|
||||||
|
|
||||||
|
# Stop HTTP server
|
||||||
|
kill $HTTP_PID 2>/dev/null || true
|
||||||
|
|
||||||
echo "=== Deployment complete ==="
|
echo "=== Deployment complete ==="
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user