mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
Feature: Add a metrics endpoint
Add a basic Prometheus Monitoring metrics endpoint. * Include a `jetkvm_build_info` metric. * `go mod tidy` Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
13
Makefile
13
Makefile
@@ -1,12 +1,21 @@
|
||||
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||
BUILDDATE ?= $(shell date --iso-8601=seconds)
|
||||
REVISION ?= $(shell git rev-parse HEAD)
|
||||
VERSION_DEV := 0.3.8-dev$(shell date +%Y%m%d%H%M)
|
||||
VERSION := 0.3.7
|
||||
|
||||
GO_LDFLAGS := \
|
||||
-s -w \
|
||||
-X github.com/prometheus/common/version.Branch=$(BRANCH) \
|
||||
-X github.com/prometheus/common/version.BuildDate=$(BUILDDATE) \
|
||||
-X github.com/prometheus/common/version.Revision=$(REVISION)
|
||||
|
||||
hash_resource:
|
||||
@shasum -a 256 resource/jetkvm_native | cut -d ' ' -f 1 > resource/jetkvm_native.sha256
|
||||
|
||||
build_dev: hash_resource
|
||||
@echo "Building..."
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w -X kvm.builtAppVersion=$(VERSION_DEV)" -o bin/jetkvm_app cmd/main.go
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="$(GO_LDFLAGS) -X kvm.builtAppVersion=$(VERSION_DEV)" -o bin/jetkvm_app cmd/main.go
|
||||
|
||||
frontend:
|
||||
cd ui && npm ci && npm run build:device
|
||||
@@ -19,7 +28,7 @@ dev_release: build_dev
|
||||
|
||||
build_release: frontend hash_resource
|
||||
@echo "Building release..."
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w -X kvm.builtAppVersion=$(VERSION)" -o bin/jetkvm_app cmd/main.go
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="$(GO_LDFLAGS) -X kvm.builtAppVersion=$(VERSION)" -o bin/jetkvm_app cmd/main.go
|
||||
|
||||
release:
|
||||
@if rclone lsf r2://jetkvm-update/app/$(VERSION)/ | grep -q "jetkvm_app"; then \
|
||||
|
||||
Reference in New Issue
Block a user