-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 809 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 809 Bytes
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
APP_NAME=blogapp
CMD_DIR=cmd/$(APP_NAME)
PORT?=3001
CACHE_CAPACITY?=30
.PHONY: run build clean test mockgen deps
# Run the application
run:
go run $(CMD_DIR)/main.go --port=$(PORT) --cache-capacity=$(CACHE_CAPACITY)
# Build the application
build:
go build -o bin/$(APP_NAME) $(CMD_DIR)/main.go
# Run tests
test:
go test -cover ./... -v
# Install dependencies
deps:
go mod tidy
go mod download
# Clean up binaries and cache
clean:
rm -rf bin/ $(APP_NAME)
go clean
# Generate mocks using mockgen
mockgen:
mockgen -source=internal/business/blogbus/blogbus.go -destination=internal/mock/business/blogbus/blogbus.go -package=mockblogbus
# Generate docs
swag:
swag init -g internal/api/http/blogapp/route.go -o ./docs
swag fmt
build-docker:
docker build -t anazibinurasheed/$(APP_NAME):latest .