-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
33 lines (27 loc) · 863 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
VERSION=0000.00
VERSION_VAR=go.qbee.io/agent/app.Version
COMMIT_VAR=go.qbee.io/agent/app.Commit
COMMIT=$(shell git describe --always --dirty --abbrev=0)
GOOS=linux
GOARCH=amd64
build:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-ldflags "-s -w -X $(VERSION_VAR)=$(VERSION) -X $(COMMIT_VAR)=$(COMMIT)" \
-trimpath \
-o bin/qbee-agent main.go
auto-build:
inotifywait -e close_write,moved_to,create -r -q -m app/ | while read line; do $(MAKE) build; done
docker-image:
docker build -t debian:qbee \
--build-arg version=2023.01 \
.
docker build -t rhel:qbee \
--build-arg version=2023.01 \
-f Dockerfile.rhel9 .
docker build -t openwrt:qbee \
--build-arg version=2023.01 \
-f Dockerfile.openwrt .
test-src:
go test ./app/...
lint:
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.55.2 golangci-lint run