mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-28 15:45:00 +02:00
* Added build-cloud to Makefile * Fix env var key GOOS * Added taskSetReleaseVersion for edgeboxctl version option write into DB * taskGetSystemUptime to run every 5 ticks * Added support for detecting main disk in cloud version * Added missing import * Finding main device in test * Refactored GetDevices and test to use release_version * Added utils.getIP function, set to run as a 60 tick scheduled task * Added taskEnablePublicDashboard and taskDisablePublicDashboard * Added utils.WriteOption and refactor, added enablePublicDashb0oard * Finalizing online support for dashboard, cloud version support * Added task SetupCloudOptions * Added couple of func description comments * Early return statement (thanks @inverse) * Using IsPublicDashboard in DisablePublicDashboard func * Added constants for release version and device types, added diagnostics.GetReleaseVersion * Removed codecov from test action
36 lines
969 B
Makefile
36 lines
969 B
Makefile
PROJECT?=github.com/edgebox-iot/edgeboxctl
|
|
|
|
RELEASE ?= dev
|
|
COMMIT := $(shell git rev-parse --short HEAD)
|
|
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
|
BUILD_DIR = bin
|
|
|
|
build-all:
|
|
GOOS=linux GOARCH=amd64 make build
|
|
GOOS=linux GOARCH=arm make build
|
|
|
|
build-prod:
|
|
GOOS=linux GOARCH=arm RELEASE=prod make build
|
|
|
|
build-cloud:
|
|
GOOS=linux GOARCH=amd64 RELEASE=cloud make build
|
|
|
|
build:
|
|
@echo "Building ${GOOS}-${GOARCH}"
|
|
GOOS=${GOOS} GOARCH=${GOARCH} go build \
|
|
-trimpath -ldflags "-s -w -X ${PROJECT}/internal/diagnostics.Version=${RELEASE} \
|
|
-X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \
|
|
-X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \
|
|
-o bin/edgeboxctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/edgeboxctl
|
|
cp ./bin/edgeboxctl-${GOOS}-${GOARCH} ./bin/edgeboxctl
|
|
|
|
clean:
|
|
rm -rf ${BUILD_DIR}
|
|
go clean
|
|
|
|
test:
|
|
go test -tags=unit -timeout=600s -v ./...
|
|
|
|
test-with-coverage:
|
|
go test -tags=unit -timeout=600s -v ./... -coverprofile=coverage.out
|