4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
0
|
.PHONY: all build image test help |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
1
|
all: help |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
2
|
|
813b687 |
Jakob Wakeling |
2024-01-18 16:05:48 |
3
|
MODULE = "$(shell go list -m)" |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
4
|
PROGRAM = "goit" |
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
5
|
VERSION ?= "dev" |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
6
|
|
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
7
|
build: ## Build the project |
945fd71 |
Jakob Wakeling |
2023-11-05 15:39:31 |
8
|
@go build -ldflags "-X $(MODULE)/res.Version=$(VERSION)" -o ./bin/$(PROGRAM) ./src |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
9
|
|
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
10
|
image: ## Build the project image |
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
11
|
@docker build -t $(PROGRAM):$(VERSION) --build-arg version=$(VERSION) . |
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
12
|
|
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
13
|
test: ## Run unit tests |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
14
|
@go test ./... |
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
15
|
|
edde491 |
Jakob Wakeling |
2023-09-07 21:47:49 |
16
|
help: ## Display help information |
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
17
|
@grep -E '^[a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | \ |
4c7b023 |
Jakob Wakeling |
2023-12-17 20:00:10 |
18
|
awk 'BEGIN {FS = ":.*?## *"}; {printf "\033[36m%-6s\033[0m %s\n", $$1, $$2}' |
|
|
|
19
|
|