-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (25 loc) · 846 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
PROJECT_DIR = $(CURDIR)
PROJECT_BIN = ${PROJECT_DIR}/bin
TOOLS_BIN = ${PROJECT_DIR}/tools
.PHONY: bin.build
bin.build:
mkdir -p ${PROJECT_DIR}/build
rm -f ${PROJECT_DIR}/build/blk
go build -ldflags="-s -w" -o ${PROJECT_DIR}/build/blk ${PROJECT_DIR}/cmd/app/main.go
.PHONY: up
up:
sudo docker compose -f docker-compose.yaml up --build -d
.PHONY: run.local
run.local: bin.build
${PROJECT_DIR}/build/blk
.PHONY: test
test:
sudo docker compose -f docker-compose.test.yaml up --build --abort-on-container-exit
sudo docker compose -f docker-compose.test.yaml down --volumes
.PHONY: get.tools
get.tools:
mkdir -p ${TOOLS_BIN}
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${TOOLS_BIN} v1.59.0
.PHONY: lint
lint:
${TOOLS_BIN}/golangci-lint run --config ./.golangci-lint.yaml ./...