-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 914 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
34
35
36
37
38
39
#!/usr/bin/make
.DEFAULT_GOAL := help
.PHONY: help
DOCKER_COMPOSE ?= docker compose -f docker-compose.yml
export GOOS=linux
export GOARCH=amd64
help: ## Help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
fmt: ## Automatically format source code
go fmt ./...
.PHONY:fmt
lint: fmt ## Check code (lint)
golangci-lint run ./... --config .golangci.pipeline.yaml
.PHONY:lint
vet: fmt ## Check code (vet)
go vet -vettool=$(which shadow) ./...
.PHONY:vet
vet-shadow: fmt ## Check code with detect shadow (vet)
go vet -vettool=$(which shadow) ./...
.PHONY:vet
build: ## Build service containers
$(DOCKER_COMPOSE) build
up: vet ## Start services
$(DOCKER_COMPOSE) up -d $(SERVICES)
down: ## Down services
$(DOCKER_COMPOSE) down
clean: ## Delete all containers
$(DOCKER_COMPOSE) down --remove-orphans