forked from agessaman/MeshMonday
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.27 KB
/
Copy pathMakefile
File metadata and controls
49 lines (35 loc) · 1.27 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
SHELL := /bin/zsh
ENV_FILE := .env.local
FIXTURE ?= fixtures/mqtt/monday-sea.jsonl
.PHONY: setup run dev build test test-integration lint dev-seed replay-checkins restore-checkin-packets vacuum clean
setup:
@mkdir -p data bin
@if [ ! -f "$(ENV_FILE)" ]; then cp scripts/dev_env.example "$(ENV_FILE)"; echo "created $(ENV_FILE) from scripts/dev_env.example"; fi
@go version
run: setup
@set -a; source $(ENV_FILE); set +a; go run ./cmd/server
dev: setup
@if ! command -v air >/dev/null 2>&1; then \
echo "installing air hot-reload tool..."; \
go install github.com/air-verse/air@latest; \
fi
@set -a; source $(ENV_FILE); set +a; $$(command -v air || echo "$$(go env GOPATH)/bin/air") -c .air.toml
build:
@go build -o ./bin/weeklynet ./cmd/server
test:
@go test ./...
test-integration:
@go test ./... -run Integration
lint:
@gofmt -w $$(git ls-files '*.go')
@go vet ./...
dev-seed: setup
@set -a; source $(ENV_FILE); set +a; go run ./cmd/devseed
replay-checkins: setup
@set -a; source $(ENV_FILE); set +a; go run ./cmd/replay -fixture $(FIXTURE)
restore-checkin-packets: setup
@set -a; source $(ENV_FILE); set +a; go run ./cmd/restorecheckinpackets
vacuum: setup
@set -a; source $(ENV_FILE); set +a; sqlite3 "$$SQLITE_PATH" 'VACUUM;'
clean:
@rm -rf ./bin ./data/*_test.db