This repository was archived by the owner on Jan 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
163 lines (137 loc) · 4.36 KB
/
Makefile
File metadata and controls
163 lines (137 loc) · 4.36 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.PHONY: help build build-all install clean test test-coverage fmt lint dev-setup run-daemon run-server
# Default target
help:
@echo "Ravel - Containers as microVMs orchestrator"
@echo ""
@echo "Build targets:"
@echo " build-all Build all binaries (ravel, initd, jailer)"
@echo " build-ravel Build main ravel binary"
@echo " build-initd Build initd binary"
@echo " build-jailer Build jailer binary"
@echo ""
@echo "Install targets:"
@echo " install Install all binaries to /usr/bin and /opt/ravel"
@echo " install-ravel Install only ravel binary"
@echo " uninstall Remove installed binaries"
@echo ""
@echo "Development targets:"
@echo " dev-setup Setup development environment"
@echo " run-daemon Run daemon in debug mode"
@echo " run-server Run server in debug mode"
@echo " run-corro Run corrosion agent"
@echo " run-edge Run edge proxy"
@echo " run-local Run local proxy"
@echo ""
@echo "Testing targets:"
@echo " test Run all tests"
@echo " test-coverage Run tests with coverage report"
@echo " test-verbose Run tests with verbose output"
@echo ""
@echo "Code quality targets:"
@echo " fmt Format code with gofmt"
@echo " lint Run golangci-lint"
@echo " vet Run go vet"
@echo ""
@echo "Utility targets:"
@echo " clean Remove built binaries"
@echo " deps Download dependencies"
@echo " tidy Tidy go modules"
# Build targets
build-all: build-ravel build-initd build-jailer
@echo "All binaries built successfully"
build-ravel:
@echo "Building ravel..."
@CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/ravel cmd/ravel/ravel.go
build-initd:
@echo "Building initd..."
@CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/initd cmd/initd/initd.go
build-jailer:
@echo "Building jailer..."
@CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/jailer cmd/jailer/jailer.go
# Install targets
install: build-all
@echo "Installing binaries..."
@sudo mkdir -p /opt/ravel
@sudo cp ./bin/ravel /usr/bin/ravel
@sudo cp ./bin/initd /opt/ravel/initd
@sudo cp ./bin/jailer /opt/ravel/jailer
@sudo chmod +x /usr/bin/ravel
@sudo chmod +x /opt/ravel/initd
@sudo chmod +x /opt/ravel/jailer
@echo "Installation complete"
install-ravel: build-ravel
@echo "Installing ravel binary..."
@sudo cp ./bin/ravel /usr/bin/ravel
@sudo chmod +x /usr/bin/ravel
@echo "Ravel installed to /usr/bin/ravel"
uninstall:
@echo "Uninstalling Ravel..."
@sudo rm -f /usr/bin/ravel
@sudo rm -rf /opt/ravel
@echo "Uninstall complete"
# Development targets
dev-setup:
@echo "Setting up development environment..."
@go mod download
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@echo "Development environment ready"
run-daemon:
@echo "Starting daemon in debug mode..."
@sudo go run cmd/ravel/ravel.go daemon -c ravel.toml --debug
run-server:
@echo "Starting server in debug mode..."
@go run cmd/ravel/ravel.go server -c ravel.toml --debug
run-corro:
@echo "Starting corrosion agent..."
@sudo corrosion agent -c docs/examples/corrosion-config.toml
run-edge:
@echo "Starting edge proxy..."
@sudo go run cmd/ravel-proxy/ravel-proxy.go start -m edge -c proxy.toml --debug
run-local:
@echo "Starting local proxy..."
@sudo go run cmd/ravel-proxy/ravel-proxy.go start -m local -c proxy.toml --debug
# Testing targets
test:
@echo "Running tests..."
@go test -v ./...
test-coverage:
@echo "Running tests with coverage..."
@go test -v -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
test-verbose:
@echo "Running tests with verbose output..."
@go test -v -race ./...
test-short:
@echo "Running short tests..."
@go test -short ./...
# Code quality targets
fmt:
@echo "Formatting code..."
@gofmt -s -w .
@echo "Code formatted"
lint:
@echo "Running linter..."
@golangci-lint run ./...
vet:
@echo "Running go vet..."
@go vet ./...
check: fmt vet lint
@echo "All checks passed"
# Utility targets
clean:
@echo "Cleaning build artifacts..."
@rm -rf bin/
@rm -f coverage.out coverage.html
@echo "Clean complete"
deps:
@echo "Downloading dependencies..."
@go mod download
@echo "Dependencies downloaded"
tidy:
@echo "Tidying go modules..."
@go mod tidy
@echo "Modules tidied"
# Legacy aliases for compatibility
run-raveld: run-daemon
run-api: run-server