-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (35 loc) · 1.15 KB
/
Makefile
File metadata and controls
38 lines (35 loc) · 1.15 KB
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
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)
all: help
## Build:
build: ## Build your project and put the output binary in out/bin/
docker-compose build
## Run
run:## Run Runs your project
docker-compose up
## Dev
dev: ## Runs The app with hot reload in a Docker container
air --config=.air.toml
## Vendor
vendor: ## Copy of all packages needed to support builds and tests in the vendor directory
go mod vendor
## gen
gen: ## Generate codes for ent schemas
go generate ./internal/ent
## schema
schema: ## creates a new Ent Schema like : make schema S=<Your Schema Name>
go run -mod=mod entgo.io/ent/cmd/ent new --target internal/ent/schema ${S}
## Help:
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)