-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.06 KB
/
Copy pathMakefile
File metadata and controls
64 lines (49 loc) · 1.06 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
.PHONY: build run test clean docker geoip
APP_NAME=defenra-agent
GEOIP_DB=GeoLite2-City.mmdb
build:
@echo "Building $(APP_NAME)..."
go build -o $(APP_NAME) .
run: build
@echo "Running $(APP_NAME)..."
./$(APP_NAME)
test:
@echo "Running tests..."
go test -v ./...
clean:
@echo "Cleaning up..."
rm -f $(APP_NAME)
rm -f $(APP_NAME).exe
docker:
@echo "Building Docker image..."
docker build -t defenra-agent:latest .
docker-run:
@echo "Running Docker container..."
docker run -d \
-p 53:53/udp \
-p 53:53/tcp \
-p 80:80 \
-p 443:443 \
-p 8080:8080 \
--env-file .env \
--name defenra-agent \
defenra-agent:latest
geoip:
@echo "Downloading GeoIP database..."
wget -O $(GEOIP_DB) https://github.com/Defenra/DefenraCore/raw/refs/heads/main/data/GeoLite2-City.mmdb
deps:
@echo "Downloading dependencies..."
go mod download
tidy:
@echo "Tidying dependencies..."
go mod tidy
fmt:
@echo "Formatting code..."
go fmt ./...
vet:
@echo "Vetting code..."
go vet ./...
lint: fmt vet
@echo "Linting complete"
all: deps lint build
.DEFAULT_GOAL := build