forked from hypertrace/hypertrace-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (25 loc) · 810 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
VERSION ?= dev
GIT_HASH ?=$(shell git rev-parse HEAD)
IMAGE_NAME ?= "hypertrace/collector"
CONFIG_FILE ?= ./default-config.yml
.PHONY: unit-test
unit-test:
go test -count=1 -v -race -cover ./...
.PHONY: test
test: unit-test
.PHONY: build
build:
$(if $(GOOS),GOOS=${GOOS},) go build -ldflags "-w -X main.GitHash=${GIT_HASH} -X main.Version=${VERSION}" ./cmd/collector
.PHONY: run
run:
go run -ldflags "-w -X main.GitHash=${GIT_HASH} -X main.Version=${VERSION}" cmd/collector/* --config ${CONFIG_FILE}
.PHONY: package
package:
@docker build --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$(GIT_COMMIT) -t $(IMAGE_NAME):${VERSION} .
.PHONY: docker-push
docker-push:
docker push ${DOCKER_IMAGE}:${VERSION}
.PHONY: lint
lint:
@echo "Running linters..."
@golangci-lint run ./... && echo "Done."