-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
33 lines (25 loc) · 800 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
APP-BIN := ./bin/monkeybeat.bin
LAST_COMMIT := $(shell git rev-parse --short HEAD)
LAST_COMMIT_DATE := $(shell git show -s --format=%ci ${LAST_COMMIT})
VERSION := $(shell git describe --tags)
BUILDSTR := ${VERSION} (Commit: ${LAST_COMMIT_DATE} (${LAST_COMMIT}), Build: $(shell date +"%Y-%m-%d% %H:%M:%S %z"))
.PHONY: build
build: ## Build binary.
go build -o ${APP-BIN} -ldflags="-X 'main.buildString=${BUILDSTR}'" .
.PHONY: run
run: ## Run binary.
./${APP-BIN}
.PHONY: clean
clean: ## Remove temporary files and the `bin` folder.
rm -rf bin
.PHONY: fresh
fresh: build run
.PHONY: lint
lint:
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.43.0 golangci-lint run -v
.PHONY: schema
schema:
cat schema.sql | clickhouse-client -mn
.PHONY: seed
seed:
./scripts/load_data.sh