-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (90 loc) · 1.94 KB
/
Makefile
File metadata and controls
114 lines (90 loc) · 1.94 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
.DEFAULT_GOAL := build
DOCKER_IMAGE := "ghcr.io/flared/lacuna"
#####################
## GENERAL TARGETS ##
#####################
.PHONY: ci
ci: \
build \
test \
format-check \
clippy \
frontend-ci
.PHONY: .all
.all: build test
.PHONY: build
build:
cargo build
.PHONY: run
run: frontend-build
# NOTE(aviau): Claude Desktop's preview mode passes the PORT environment
# variable when the default port is not available:
# - https://code.claude.com/docs/en/desktop#port-conflicts
ANTHROPIC_API_KEY=$${ANTHROPIC_API_KEY:-} \
BEDROCK_API_KEY=$${BEDROCK_API_KEY:-} \
cargo run -- --config examples/lacuna/lacuna.config.json --port=$${PORT:-3000}
.PHONY: fix
fix:
cargo fix --allow-dirty
.PHONY: format-check
format-check:
cargo fmt --check
.PHONY: clippy
clippy:
cargo clippy
.PHONY: clean
clean: frontend-clean
rm -rf target
#################
## API TARGETS ##
#################
.PHONY: test
test: frontend-build
cargo test
.PHONY: format
format:
cargo fmt
######################
## FRONTEND TARGETS ##
######################
.PHONY: frontend-build
frontend-build:
$(MAKE) -C frontend build
.PHONY: frontend-check
frontend-check:
$(MAKE) -C frontend check
.PHONY: frontend-format
frontend-format:
$(MAKE) -C frontend format
.PHONY: frontend-lint
frontend-lint:
$(MAKE) -C frontend lint
.PHONY: frontend-run
frontend-run:
$(MAKE) -C frontend run
.PHONY: frontend-clean
frontend-clean:
$(MAKE) -C frontend clean
.PHONY: frontend-ci
frontend-ci:
$(MAKE) -C frontend ci
###################
## DOCKER TARGETS #
###################
.PHONY: docker-build
docker-build:
docker build -t ${DOCKER_IMAGE} .
.PHONY: docker-run
docker-run:
docker run \
--init \
-it \
--rm \
-p 3000:3000 \
-v ./examples/lacuna/lacuna.config.json:/opt/lacuna/config.json \
--env=ANTHROPIC_API_KEY=$${ANTHROPIC_API_KEY:-} \
--env=BEDROCK_API_KEY=$${BEDROCK_API_KEY:-} \
${DOCKER_IMAGE} \
--host=0.0.0.0 \
--port=3000 \
--config=/opt/lacuna/config.json