-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 1.49 KB
/
Makefile
File metadata and controls
76 lines (61 loc) · 1.49 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.PHONY: build build-ui build-backend run clean docker-build docker-push test
# Variables
APP_NAME := middleware-manager
DOCKER_REPO := hhftechnology
DOCKER_TAG := latest
GO_FILES := $(shell find . -name "*.go" -not -path "./vendor/*")
# Default target
all: build
# Build everything
build: build-ui build-backend
# Build UI (Vite + TypeScript)
build-ui:
@echo "Building UI..."
cd ui && npm install && npm run build
# Build backend
build-backend:
@echo "Building backend..."
go build -o $(APP_NAME) .
# Run the application
run: build
@echo "Running application..."
./$(APP_NAME)
# Clean build artifacts
clean:
@echo "Cleaning..."
rm -f $(APP_NAME)
rm -rf ui/dist
# Build Docker image
docker-build: build
@echo "Building Docker image..."
docker build -t $(DOCKER_REPO)/$(APP_NAME):$(DOCKER_TAG) .
# Push Docker image
docker-push: docker-build
@echo "Pushing Docker image..."
docker push $(DOCKER_REPO)/$(APP_NAME):$(DOCKER_TAG)
# Run tests
test:
@echo "Running tests..."
go test -v ./...
# Run the application in development mode
dev:
@echo "Running in development mode..."
go run main.go
# Run the UI in development mode
dev-ui:
@echo "Running UI in development mode..."
cd ui && npm run dev
# Install dependencies
deps:
@echo "Installing Go dependencies..."
go mod download
@echo "Installing UI dependencies..."
cd ui && npm install
# Type check the UI
typecheck:
@echo "Type checking UI..."
cd ui && npm run typecheck
# Lint the UI
lint-ui:
@echo "Linting UI..."
cd ui && npm run lint