-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (31 loc) · 888 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (31 loc) · 888 Bytes
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
# Detect OS
OS := $(shell uname -s 2>/dev/null || echo Windows_NT)
# Use 'set' for Windows, 'export' for macOS/Linux
ifeq ($(OS), Windows_NT)
EXPORT_ENV = set
CMD_PREFIX = cmd /C
else
EXPORT_ENV = export
CMD_PREFIX =
endif
# Default environment file
ENV_FILE := .env
run:
@echo "Running in development mode"
@$(CMD_PREFIX) $(EXPORT_ENV) ENV=development && go run main.go
run-test:
@echo "Running in test mode"
@$(CMD_PREFIX) $(EXPORT_ENV) ENV=test && go run main.go
run-prod:
@echo "Running in production mode"
@$(CMD_PREFIX) $(EXPORT_ENV) ENV=production && go run main.go
populate_db:
@echo "Populating database..."
@go run scripts/populate_db/populate_db.go
wipe_db:
@echo "Wiping database..."
@go run scripts/wipe_db/wipe_db.go
repopulate_db: wipe_db populate_db
test-database:
@echo "Running database tests..."
@go test ./services/schemas/ -v -cover