-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
62 lines (45 loc) · 1.7 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
SHELL=/bin/bash
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)
else
YELLOW := ""
endif
.PHONY: sqlc
build: dist/api dist/jobs dist/pubsub-helper
dist/api dist/jobs dist/pubsub-helper: ./**/*.go sqlc/.generated
CGO_ENABLED=0 go build -v -o $@ ./cmd/$(@F)
sqlc/.generated: ../migrations/*.sql
@sqlc generate || (printf "${YELLOW}Are you missing sqlc? Install it, e.g. with brew install sqlc.${RESET}\n" && false)
touch .generated
run:
@echo "No 'run'. Did you mean 'run-api'?"
install-dep-macos:
brew install sqlc
gql.api:
cd graph/api && go run github.com/99designs/gqlgen
gql.public:
cd graph/public && go run github.com/99designs/gqlgen
gql.admin:
cd graph/admin && go run github.com/99designs/gqlgen
gql: gql.api gql.public gql.admin
test.elastic:
go test ./search/... -elastic -v
topic.create:
go run ./cmd/pubsub-helper -task create -host localhost:8681
topic.delete:
go run ./cmd/pubsub-helper -task delete -host localhost:8681
event.search.reindex:
go run ./cmd/pubsub-helper -task searchReindex -host localhost:8681
event.translations.sync:
go run ./cmd/pubsub-helper -task syncTranslations -host localhost:8681
run-api: dist/api
@cp -n ./cmd/api/env.sample ./cmd/api/.env || true
@printf "${YELLOW}Running the API.\nRemember to update ./cmd/api/.env with proper values!${RESET}\n\n\n"
go run github.com/joho/godotenv/cmd/godotenv@latest -f ./cmd/api/.env dist/api
test.integration:
docker rm -f redis-integration-test
docker run --name redis-integration-test -d -p 6999:6379 redis
export REDIS_ADDRESS=localhost:6999 && go test ./... -tags=integration
docker rm -f redis-integration-test