-
Notifications
You must be signed in to change notification settings - Fork 89
/
Makefile
94 lines (71 loc) · 2.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
help:
@echo "Availabe commands:"
@echo "------------------"
@echo "migrate - run database migration"
@echo "dev - run server"
@echo "test - run all tests"
@echo "env - creates a basic .env file"
@echo "database - start database with .env vars"
@echo "kafka - start local kafka"
@echo "unleash - start local unleash server"
@echo "infra - start all infrastructure locally (kafka, unleash, and postgres db)"
@echo "clean - tear down database"
@echo "clean-all - tear down all local infrastructure"
@echo "validate-schema - validates chrome static JSON schemas"
@echo "parse-services - creates services-generated.json that with filled link refs"
@echo "dev-static - serve only the static direcory using simple go server"
@echo "dev-static-node - serve only the static direcory using simple node server"
@echo " arguments:"
@echo " - port: http server port 'make dev-static-node port=8888'"
@echo "audit - run grype audit on the docker image"
@echo "generate-search-index - generate search index"
port?=8000
env:
@if [ -f .env ]; then \
echo "File .env already exists; Please copy from .env.example manually to avoid losing any data."; \
echo "If you don't care about losing any keys or entries, delete your .env file and run this again"; \
exit 1; \
fi
cp .env.example .env
migrate:
go run cmd/migrate/migrate.go
database:
podman-compose up
clean:
podman-compose down
validate-schema:
go run cmd/validate/*
publish-search-index:
go run cmd/search/*
publish-search-index-dry-run: export SEARCH_INDEX_DRY_RUN = true
publish-search-index-dry-run:
go run cmd/search/*
generate-search-index: export SEARCH_INDEX_WRITE = true
generate-search-index:
go run cmd/search/*
kafka:
podman-compose -f local/kafka-compose.yaml up
unleash:
podman-compose -f local/unleash-compose.yaml up
infra:
podman-compose -f local/full-stack-compose.yaml down
podman-compose -f local/full-stack-compose.yaml up
clean-all:
podman-compose -f local/full-stack-compose.yaml down
test: seed-unleash
go test -v ./... -coverprofile=c.out
coverage:
go tool cover -html=c.out
seed-unleash:
go run cmd/unleash/seed.go
parse-services:
go run cmd/services/parseServices.go
audit:
docker build . -t chrome:audit
grype chrome:audit --fail-on medium --only-fixed
dev-static-node: generate-search-index parse-services
npx http-server . -a :: -p $(port)
dev-static: generate-search-index parse-services
go run cmd/static/static.go $(port)
dev: seed-unleash generate-search-index parse-services
go run main.go