-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 1.25 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
MAKEFLAGS += --no-print-directory
## ---------------------------------------------------------------------------
## | The purpose of this Makefile is to provide all the functionality needed |
## | to install, develop, build, and run this app. |
## ---------------------------------------------------------------------------
help: ## Show this help
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST)
install: ## Install all dependencies
@go mod tidy
build: ## Build a binary for the app
@$(MAKE) install
@go build -o ./bin/app cmd/main.go
dev: ## Run a dev server and watch files to rebuild
@$(MAKE) install
@go run cmd/main.go
serve: ## Build and run the production binary
@$(MAKE) build
@./bin/app
test: ## Run tests
@$(MAKE) install
@go test ./... -v
docker: ## Spin down docker containers and then rebuild and run them
@docker compose down
@docker compose up -d --build
format: ## Format code
@gofmt -s -w .
list-updates: ## List updates to go dependencies
@go list -m -u all
update: ## Update all go dependencies and install
@go get -u ./...
@$(MAKE) install
clean: ## Remove build files
@rm -rf bin