-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 814 Bytes
/
Makefile
File metadata and controls
38 lines (29 loc) · 814 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
.PHONY: build test fmt run docker-up clean setup install-tools
BINARY_NAME=build/go-service
TOOLS=golang.org/x/tools/cmd/goimports golang.org/x/lint/golint github.com/evilmartians/lefthook
build:
@echo "Building Go application..."
go build -o $(BINARY_NAME) ./cmd/main.go
@echo "Build successful."
test:
@echo "Running tests..."
go test ./...
fmt:
@echo "Formatting code..."
go fmt ./...
run: build
@echo "Running application..."
./$(BINARY_NAME)
docker-up:
@echo "Starting Dockerized environment..."
docker-compose up --build
clean:
@echo "Cleaning build artifacts..."
rm -f $(BINARY_NAME)
docker-compose down
install-tools:
@echo "Installing development tools..."
go install $(TOOLS)
setup: install-tools
@echo "Installing lefthook Git hooks..."
@$(go env GOPATH)/bin/lefthook install