-
-
Notifications
You must be signed in to change notification settings - Fork 275
/
Makefile
44 lines (35 loc) · 1.03 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
.PHONY: build clean test package serve run-compose-test
VERSION := $(shell git describe --always |sed -e "s/^v//")
build:
@echo "Compiling source"
@mkdir -p build
go build $(GO_EXTRA_BUILD_ARGS) -ldflags "-s -w -X main.version=$(VERSION)" -o build/chirpstack-gateway-bridge cmd/chirpstack-gateway-bridge/main.go
clean:
@echo "Cleaning up workspace"
@rm -rf build
@rm -rf dist
test:
@echo "Running tests"
@rm -f coverage.out
@golint ./...
@go vet ./...
@go test -cover -v -coverprofile coverage.out -p 1 ./...
dist:
@goreleaser
mkdir -p dist/upload/tar
mkdir -p dist/upload/deb
mkdir -p dist/upload/rpm
mv dist/*.tar.gz dist/upload/tar
mv dist/*.deb dist/upload/deb
mv dist/*.rpm dist/upload/rpm
snapshot:
@goreleaser --snapshot
dev-requirements:
go install golang.org/x/lint/golint
go install github.com/goreleaser/goreleaser
go install github.com/goreleaser/nfpm
# shortcuts for development
serve: build
./build/chirpstack-gateway-bridge
run-compose-test:
docker compose run --rm chirpstack-gateway-bridge make test