docs: add installation guide and deploy:install mise task
- docs/INSTALL.md covers all 6 install methods (local SCP, package install, SDK build, official feeds, custom feed, Image Builder/ASU) - deploy:install mise task: one-command SCP + service restart to an OpenWrt device with HOST env var support (default root@192.168.15.1)
This commit is contained in:
55
mise.toml
55
mise.toml
@@ -64,3 +64,58 @@ docker exec openwrt-luci sh -c "uci set zt-gateway.global.active_gateway=amsterd
|
||||
description = "Full CI: build stack + install browsers + run E2E"
|
||||
depends = ["docker:up", "setup"]
|
||||
run = "npx playwright test"
|
||||
|
||||
|
||||
# ===============================
|
||||
# Deployment
|
||||
# ===============================
|
||||
|
||||
[tasks."deploy:install"]
|
||||
description = "SCP app files to an OpenWrt device and restart services"
|
||||
run = '''
|
||||
set -e
|
||||
|
||||
HOST="${HOST:-root@192.168.15.1}"
|
||||
|
||||
echo "==> Checking connectivity to ${HOST}..."
|
||||
if ! ssh -o ConnectTimeout=5 -o BatchMode=yes "$HOST" true 2>/dev/null; then
|
||||
echo "ERROR: Cannot reach ${HOST}. Check SSH access."
|
||||
echo " ssh-copy-id ${HOST} # if needed"
|
||||
exit 1
|
||||
fi
|
||||
echo " ${HOST} is reachable."
|
||||
|
||||
echo "==> Uploading files..."
|
||||
|
||||
# root/ files → strip leading root/, map to / on device
|
||||
scp -q root/usr/sbin/zt-gateway-switch "$HOST:/usr/sbin/"
|
||||
echo " zt-gateway-switch"
|
||||
scp -q root/usr/share/rpcd/ucode/zt-gateway.uc "$HOST:/usr/share/rpcd/ucode/"
|
||||
echo " rpcd/ucode/zt-gateway.uc"
|
||||
scp -q root/usr/share/rpcd/ucode/system.uc "$HOST:/usr/share/rpcd/ucode/"
|
||||
echo " rpcd/ucode/system.uc"
|
||||
scp -q root/usr/share/ucode/luci/runtime.uc "$HOST:/usr/share/ucode/luci/"
|
||||
echo " ucode/luci/runtime.uc"
|
||||
scp -q root/usr/share/luci/menu.d/luci-app-zt-gateway.json "$HOST:/usr/share/luci/menu.d/"
|
||||
echo " menu.d/luci-app-zt-gateway.json"
|
||||
scp -q root/usr/share/rpcd/acl.d/luci-app-zt-gateway.json "$HOST:/usr/share/rpcd/acl.d/"
|
||||
echo " acl.d/luci-app-zt-gateway.json"
|
||||
scp -q root/etc/config/zt-gateway "$HOST:/etc/config/"
|
||||
echo " config/zt-gateway"
|
||||
|
||||
# Frontend view
|
||||
ssh -q "$HOST" mkdir -p /www/luci-static/resources/view/zt-gateway
|
||||
scp -q htdocs/luci-static/resources/view/zt-gateway/overview.js "$HOST:/www/luci-static/resources/view/zt-gateway/"
|
||||
echo " overview.js"
|
||||
|
||||
echo "==> Setting permissions..."
|
||||
ssh -q "$HOST" chmod +x /usr/sbin/zt-gateway-switch
|
||||
|
||||
echo "==> Restarting rpcd and uhttpd..."
|
||||
ssh -q "$HOST" /etc/init.d/rpcd restart
|
||||
ssh -q "$HOST" /etc/init.d/uhttpd restart
|
||||
|
||||
DEVICE_IP=$(echo "$HOST" | sed 's/.*@//')
|
||||
echo ""
|
||||
echo "==> Done! Open: http://${DEVICE_IP}/cgi-bin/luci/admin/services/zt-gateway"
|
||||
'''
|
||||
Reference in New Issue
Block a user