-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·54 lines (46 loc) · 1.29 KB
/
Copy pathmakefile
File metadata and controls
executable file
·54 lines (46 loc) · 1.29 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
# Makefile for Go Cybersecurity AI Project
.DEFAULT_GOAL := help
# Go variables
BINARY_NAME_API := cyber-api
BINARY_NAME_MIGRATE := cyber-migrate
CMD_PATH_API := ./cmd/api
CMD_PATH_MIGRATE := ./cmd/migrate
# Build commands
.PHONY: build
build:
@echo "Building API server..."
@go build -o bin/$(BINARY_NAME_API) $(CMD_PATH_API)/main.go
@echo "Building migration tool..."
@go build -o bin/$(BINARY_NAME_MIGRATE) $(CMD_PATH_MIGRATE)/main.go
@echo "Build complete."
# Run the API server
.PHONY: run
run: build
@echo "Starting API server..."
@./bin/$(BINARY_NAME_API)
# Run migrations
.PHONY: migrate
migrate: build
@echo "Running database migrations..."
@./bin/$(BINARY_NAME_MIGRATE) migrate
# Run database seeding
.PHONY: seed
seed: build
@echo "Seeding database..."
@./bin/$(BINARY_NAME_MIGRATE) seed
# Clean build artifacts
.PHONY: clean
clean:
@echo "Cleaning..."
@go clean
@rm -f bin/$(BINARY_NAME_API)
@rm -f bin/$(BINARY_NAME_MIGRATE)
# Show help
.PHONY: help
help:
@echo "Available commands:"
@echo " make build - Build the API server and migration tool"
@echo " make run - Build and run the API server"
@echo " make migrate - Build and run the database migrations"
@echo " make seed - Build and run the database seeder"
@echo " make clean - Remove build artifacts"