-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 675 Bytes
/
Makefile
File metadata and controls
35 lines (28 loc) · 675 Bytes
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
BUILD_COMMIT:=$(or $(BUILD_COMMIT),$(shell git rev-parse --short HEAD))
.PHONY: vendors
vendors:
go mod download
.PHONY: format
format:
go fmt ./...
.PHONY: lint
lint:
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint golangci-lint run
.PHONY: test
test:
go test -race -cover ./...
.PHONY: run
run:
go run cmd/webhug.go
.PHONY: build
build: vendors
mkdir -p build/bin
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o build/bin/webhug cmd/webhug.go
.PHONY: build-docker
build-docker:
docker build -f Dockerfile \
--build-arg "BUILD_COMMIT=$(BUILD_COMMIT)" \
-t webhug \
-t webhug:latest \
-t webhug:$(BUILD_COMMIT) \
.