mirror of https://github.com/jetkvm/kvm.git
Add -i/--install option to dev_deploy.sh
Running `dev_deploy.sh -i` will build the app in release mode and install it to the device for longer term development/testing or just running a custom variant of the app.
This commit is contained in:
parent
1f7c5c94d8
commit
5d18462a51
|
@ -28,6 +28,7 @@ show_help() {
|
||||||
echo " --run-go-tests Run go tests"
|
echo " --run-go-tests Run go tests"
|
||||||
echo " --run-go-tests-only Run go tests and exit"
|
echo " --run-go-tests-only Run go tests and exit"
|
||||||
echo " --skip-ui-build Skip frontend/UI build"
|
echo " --skip-ui-build Skip frontend/UI build"
|
||||||
|
echo " -i, --install Build for release and install the app"
|
||||||
echo " --help Display this help message"
|
echo " --help Display this help message"
|
||||||
echo
|
echo
|
||||||
echo "Example:"
|
echo "Example:"
|
||||||
|
@ -43,6 +44,7 @@ RESET_USB_HID_DEVICE=false
|
||||||
LOG_TRACE_SCOPES="${LOG_TRACE_SCOPES:-jetkvm,cloud,websocket,native,jsonrpc}"
|
LOG_TRACE_SCOPES="${LOG_TRACE_SCOPES:-jetkvm,cloud,websocket,native,jsonrpc}"
|
||||||
RUN_GO_TESTS=false
|
RUN_GO_TESTS=false
|
||||||
RUN_GO_TESTS_ONLY=false
|
RUN_GO_TESTS_ONLY=false
|
||||||
|
INSTALL_APP=false
|
||||||
|
|
||||||
# Parse command line arguments
|
# Parse command line arguments
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
|
@ -72,6 +74,10 @@ while [[ $# -gt 0 ]]; do
|
||||||
RUN_GO_TESTS=true
|
RUN_GO_TESTS=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-i|--install)
|
||||||
|
INSTALL_APP=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--help)
|
--help)
|
||||||
show_help
|
show_help
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -139,7 +145,18 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "▶ Building go binary"
|
if [ "$INSTALL_APP" = true ]
|
||||||
|
then
|
||||||
|
msg_info "▶ Building release binary"
|
||||||
|
make build_release
|
||||||
|
|
||||||
|
# Copy the binary to the remote host as if we were the OTA updater.
|
||||||
|
ssh "${REMOTE_USER}@${REMOTE_HOST}" "cat > /userdata/jetkvm/jetkvm_app.update" < bin/jetkvm_app
|
||||||
|
|
||||||
|
# Reboot the device, the new app will be deployed by the startup process.
|
||||||
|
ssh "${REMOTE_USER}@${REMOTE_HOST}" "reboot"
|
||||||
|
else
|
||||||
|
msg_info "▶ Building development binary"
|
||||||
make build_dev
|
make build_dev
|
||||||
|
|
||||||
# Kill any existing instances of the application
|
# Kill any existing instances of the application
|
||||||
|
@ -176,5 +193,6 @@ chmod +x jetkvm_app_debug
|
||||||
# Run the application in the background
|
# Run the application in the background
|
||||||
PION_LOG_TRACE=${LOG_TRACE_SCOPES} ./jetkvm_app_debug
|
PION_LOG_TRACE=${LOG_TRACE_SCOPES} ./jetkvm_app_debug
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Deployment complete."
|
echo "Deployment complete."
|
Loading…
Reference in New Issue