-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
70 lines (50 loc) · 1.17 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
all: build
setup: tidy
go mod download
tidy:
go mod tidy
build:
go build -o sources-api-go .
clean:
go clean
run: build
./sources-api-go
inlinerun:
go run .
listener:
go run . -listener
backgroundworker:
go run . -background-worker
container:
docker build . -t sources-api-go
remotedebug:
dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient
debug:
dlv debug
test:
go test ./...
alltest: test
go test ./... --integration
lint:
go vet ./...
golangci-lint run -E gofmt,gci,bodyclose,forcetypeassert,misspell
gci:
golangci-lint run -E gci --fix
vault:
# runs a server locally - with `root` as the token. useful for development
docker run -it --rm --cap-add=IPC_LOCK \
-e 'VAULT_DEV_ROOT_TOKEN_ID=root' \
-e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' \
-p 8200:8200 vault
generate:
go generate ./...
migration:
@sh db/migrations/new_migration.sh
docker-up:
@docker-compose up -d sources-db sources-kafka
@sleep 7
@mkdir -p tmp/db
@docker-compose up sources-api-db-setup
@docker-compose up init-kafka
@docker-compose up -d
.PHONY: setup tidy build clean run container remotedebug debug test lint gci vault listener alltest generate