-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (38 loc) · 1.13 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
IMAGE := hsmade/osm-ardf
VERSION := $(shell git describe --tags 2>/dev/null)
BUILD := $(shell git rev-parse --short HEAD)
ifndef VERSION
VERSION = 0.0.0
endif
ifdef BUILD
TAG = "${VERSION}-${BUILD}"
else
TAG = "${VERSION}"
endif
image: test
docker build -t ${IMAGE}:${TAG} -f build/package/Dockerfile .
lint:
go fmt ./...
go generate ./...
go vet ./...
download:
go mod tidy
go mod download
go mod verify
test: download lint
go test -tags dev -v -coverprofile=coverage.out ./...
coverage: test
go tool cover -html=coverage.out
compile:
go build -ldflags="-w -extldflags -s" -o dist/aprs_receiver ./cmd/aprs_receiver/aprs_receiver.go
go build -ldflags="-w -extldflags -s" -o dist/udp_receiver ./cmd/udp_receiver/udp_receiver.go
go build -ldflags="-w -extldflags -s" -o dist/stdin_receiver ./cmd/stdin_receiver/stdin_receiver.go
go generate ./...
go build -ldflags="-w -extldflags -s" -o dist/web_server ./cmd/web_server/web_server.go
clean:
go clean
upload: image
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker push ${IMAGE}:${TAG}
test_webserver:
go run -tags dev -ldflags="-w -s" ./cmd/web_server/web_server.go