make docker build enabled by default

This commit is contained in:
Siyuan 2025-09-26 13:08:16 +00:00
parent 713becd53d
commit c166602481
3 changed files with 19 additions and 9 deletions

View File

@ -111,3 +111,8 @@ func (n *Native) DoNotUseThisIsForCrashTestingOnly() {
crash() crash()
} }
// GetLVGLVersion returns the LVGL version
func GetLVGLVersion() string {
return uiGetLVGLVersion()
}

View File

@ -16,6 +16,7 @@ show_help() {
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 " --skip-native-build Skip native build" echo " --skip-native-build Skip native build"
echo " --disable-docker Disable docker build"
echo " -i, --install Build for release and install the app" echo " -i, --install Build for release and install the app"
echo " --help Display this help message" echo " --help Display this help message"
echo echo
@ -36,7 +37,7 @@ 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 INSTALL_APP=false
BUILD_IN_DOCKER=false BUILD_IN_DOCKER=true
DOCKER_BUILD_DEBUG=false DOCKER_BUILD_DEBUG=false
DOCKER_BUILD_TAG=ghcr.io/jetkvm/buildkit:latest DOCKER_BUILD_TAG=ghcr.io/jetkvm/buildkit:latest
@ -63,8 +64,8 @@ while [[ $# -gt 0 ]]; do
RESET_USB_HID_DEVICE=true RESET_USB_HID_DEVICE=true
shift shift
;; ;;
--build-in-docker) --disable-docker)
BUILD_IN_DOCKER=true BUILD_IN_DOCKER=false
shift shift
;; ;;
--docker-build-debug) --docker-build-debug)

View File

@ -5,7 +5,9 @@ import (
"encoding/json" "encoding/json"
"html/template" "html/template"
"runtime" "runtime"
"strings"
"github.com/jetkvm/kvm/internal/native"
"github.com/prometheus/common/version" "github.com/prometheus/common/version"
) )
@ -32,12 +34,10 @@ func GetVersionData(isJson bool) ([]byte, error) {
"platform": runtime.GOOS + "/" + runtime.GOARCH, "platform": runtime.GOOS + "/" + runtime.GOARCH,
} }
if nativeInstance != nil { lvglVersion := native.GetLVGLVersion()
lvglVersion, err := nativeInstance.GetLVGLVersion() if lvglVersion != "" {
if err == nil {
m["lvglVersion"] = lvglVersion m["lvglVersion"] = lvglVersion
} }
}
if isJson { if isJson {
jsonData, err := json.Marshal(m) jsonData, err := json.Marshal(m)
@ -47,7 +47,11 @@ func GetVersionData(isJson bool) ([]byte, error) {
return jsonData, nil return jsonData, nil
} }
t := template.Must(template.New("version").Parse(versionInfoTmpl)) t := template.Must(
template.New("version").Parse(
strings.TrimSpace(versionInfoTmpl),
),
)
var buf bytes.Buffer var buf bytes.Buffer
if err := t.ExecuteTemplate(&buf, "version", m); err != nil { if err := t.ExecuteTemplate(&buf, "version", m); err != nil {