This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
104 lines (78 loc) · 2.25 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
95
96
97
98
99
100
101
102
103
SCAN_SCRIPT_URL="https://raw.githubusercontent.com/findy-network/setup-go-action/master/scanner/cp_scan.sh"
.PHONY: db
scan:
@curl -s $(SCAN_SCRIPT_URL) | bash
scan_and_report:
@curl -s $(SCAN_SCRIPT_URL) | bash -s v > licenses.txt
generate:
go generate ./...
deps:
go get -t ./...
update-deps:
go get -u ./...
build:
go build -v ./...
shadow:
@echo Running govet
go vet -vettool=$(GOPATH)/bin/shadow ./...
@echo Govet success
check_fmt:
$(eval GOFILES = $(shell find . -name '*.go'))
@gofmt -l $(GOFILES)
lint:
@golangci-lint run
init-test:
-docker stop findy-agent-vault-test-db
-docker rm findy-agent-vault-test-db
-rm -rf .db/test
docker run --name findy-agent-vault-test-db \
-e POSTGRES_PASSWORD=$(FAV_DB_PASSWORD) \
-e POSTGRES_DB=vault \
-v $(PWD)/.db/test:/var/lib/postgresql/data \
-p 5433:5432 \
-d postgres:13.13-alpine
sleep 30
test:
go test -v ./...
test_cov_out:
go test \
-coverpkg=github.com/findy-network/findy-agent-vault/... \
-coverprofile=coverage.txt \
-covermode=atomic \
./...
test_cov: test_cov_out
go tool cover -html=coverage.txt
db:
-docker stop findy-agent-vault-db
-docker rm findy-agent-vault-db
-rm -rf .db/data
docker run --name findy-agent-vault-db \
-e POSTGRES_PASSWORD=$(FAV_DB_PASSWORD) \
-e POSTGRES_DB=vault \
-v $(PWD)/.db/data:/var/lib/postgresql/data \
-p 5432:5432 \
-d postgres:13.13-alpine
db_client:
docker run -it --rm --network host jbergknoff/postgresql-client postgres://postgres:$(FAV_DB_PASSWORD)@localhost:5432/vault?sslmode=disable
db_client_test:
docker run -it --rm --network host jbergknoff/postgresql-client postgres://postgres:$(FAV_DB_PASSWORD)@localhost:5433/vault?sslmode=disable
check:
go build ./...
go test ./...
golangci-lint run
remod:
-rm go*
go mod init github.com/findy-network/findy-agent-vault
go mod tidy
single_test:
go test -run TestConnect ./...
dclean:
-docker rmi findy-agent-vault
dbuild:
docker build -t findy-agent-vault .
gen_mock:
go install github.com/golang/mock/[email protected]
~/go/bin/mockgen -package listen -source ./db/store/db.go DB > ./resolver/listen/listener_mock_store_test.go
~/go/bin/mockgen -package mock -source ./agency/model/model.go Agency > ./agency/mock/mock.go
release:
gh workflow run do-release.yml