-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (35 loc) · 1.31 KB
/
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
40
41
42
43
44
45
46
.PHONY: help
help: ## Prints help for targets with comments
@grep -E '^[a-zA-Z0-9.\ _-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
lifecycle: ## Possible lifecycle of the app
@echo "init-project -> check-tools -> update -> test -> build -> docker-build"
init: ## Initialize project, add some more needed dependencies
@go get -u golang.org/x/lint/golint
@go get github.com/gavv/httpexpect/v2
@go get github.com/swaggo/swag/cmd/swag
@go get gopkg.in/go-playground/validator.v10
@go mod download
@go mod vendor
check-tools: ## Print all available versions
@go version
@golint --version
@yamllint --version
@docker --version
update: ## Update go dependencies
@go get -v all
@go mod download
@go mod tidy
@go mod vendor
test: ## Execute linter and go tests
@yamllint -c .yamllint . || echo "🔥 yamllint syntax-check failed"
@golint || echo "🔥 golint syntax-check failed"
build: ## Build This service
# @go generate **/*.go
@go build -o ether_todo_service cmd/main.go || echo "🔥 go build failed"
run: ## Build This service
# @go generate **/*.go
@./ether_todo_service
run-dev-db: ## Run docker postgres db
@docker compose up -d
docker-build: ## Build application and put it in docker container
@docker build . -t ether_todo_service