-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (49 loc) · 1.26 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: all build test run clean
# Variables
BINARY_NAME=gomon
GO=go
MAIN_PATH=cmd/gomon/main.go
# Version info
VERSION?=0.1.0
COMMIT=$(shell git rev-parse --short HEAD)
BUILD_TIME=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
# Couleurs pour le formatage
BOLD := $(shell tput bold)
BLUE := $(shell tput setaf 4)
GREEN := $(shell tput setaf 2)
YELLOW := $(shell tput setaf 3)
RED := $(shell tput setaf 1)
RESET := $(shell tput sgr0)
all: test build
# Construction du binaire
build:
@echo "Building Gomon..."
$(GO) build -o bin/$(BINARY_NAME) $(MAIN_PATH)
# Exécution des tests
test:
@echo "Running tests..."
$(GO) test -v ./...
# Lancement en mode développement
run:
@echo "Starting Gomon..."
$(GO) run $(MAIN_PATH)
# Nettoyage
clean:
@echo "Cleaning..."
rm -rf bin/
$(GO) clean
# Installation des dépendances de développement
dev-deps:
$(GO) install github.com/golang/mock/mockgen@latest
$(GO) install golang.org/x/lint/golint@latest
# Linting
lint:
golint ./...
$(GO) vet ./...
# Pour tester manuellement les endpoints avec un affichage amélioré
test-endpoints:
@echo "Testing Gomon endpoints..."
@bash scripts/test-endpoints.sh || echo "Error: Server must be running. Start with 'make run' first"
# Pour lancer le serveur
run-server:
go run cmd/gomon/main.go