-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
76 lines (64 loc) · 1.61 KB
/
Makefile
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: install
install:
@echo "Installing..."
go install github.com/bombsimon/wsl/v4/[email protected]
go install mvdan.cc/[email protected]
go install github.com/daixiang0/[email protected]
.PHONY: fmt
fmt:
@echo "Formatting..."
go mod tidy
go fmt ./...
gci write -s standard -s default -s "prefix(github.com/SecurityBrewery/catalyst)" .
gofumpt -l -w .
wsl -fix ./... || true
cd ui && bun format
.PHONY: lint
lint:
golangci-lint version
golangci-lint run ./...
.PHONY: test
test:
@echo "Testing..."
go test -v ./...
cd ui && bun test
.PHONY: test-coverage
test-coverage:
@echo "Testing with coverage..."
go test -coverpkg=./... -coverprofile=coverage.out -count 1 ./...
go tool cover -func=coverage.out
go tool cover -html=coverage.out
.PHONY: build-ui
build-ui:
@echo "Building..."
cd ui && bun install
cd ui && bun build-only
.PHONY: build
build: build-ui
@echo "Building..."
go build -o catalyst .
.PHONY: build-linux
build-linux: build-ui
@echo "Building..."
GOOS=linux GOARCH=amd64 go build -o catalyst .
.PHONY: docker
docker: build-linux
@echo "Building Docker image..."
docker build -f docker/Dockerfile -t catalyst .
.PHONY: dev
dev:
@echo "Running..."
rm -rf catalyst_data
go run . admin create [email protected] 1234567890
go run . fake-data
go run . serve --app-url http://localhost:8090 --flags dev
.PHONY: dev-10000
dev-10000:
@echo "Running..."
rm -rf catalyst_data
go run . admin create [email protected] 1234567890
go run . fake-data --users 100 --tickets 10000
go run . serve --app-url http://localhost:8090 --flags dev
.PHONY: serve-ui
serve-ui:
cd ui && bun dev --port 3000