forked from OdyseeTeam/odysee-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (59 loc) · 2.26 KB
/
Makefile
File metadata and controls
73 lines (59 loc) · 2.26 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
date := $(shell date "+%Y-%m-%d-%H-%M")
api_version := $(shell git describe --tags --match 'api-v*'|sed -e 's/.*\-v//')
watchman_version := $(shell git describe --tags --match 'watchman-v*'|sed -e 's/.*\-v//')
git_hash := $(shell git rev-parse --short HEAD)
.PHONY: test
test:
go test -cover ./...
.PHONY: test_race
test_race:
go test -race -gcflags=all=-d=checkptr=0 ./...
prepare_test:
cd tools && \
go install $(go list -tags tools -f '{{range $_, $p := .Imports}}{{$p}} {{end}}')
go run . db_migrate_up
.PHONY: test_circleci
test_circleci:
scripts/wait_for_wallet.sh
cd tools &&\
go install $(go list -tags tools -f '{{range $_, $p := .Imports}}{{$p}} {{end}}')
go run . db_migrate_up
go test -covermode=count -coverprofile=coverage.out ./...
goveralls -coverprofile=coverage.out -service=circle-ci -ignore=models/ -repotoken $(COVERALLS_TOKEN)
.PHONY: clean
clean:
find . -name rice-box.go | xargs rm
rm -rf ./dist
.PHONY: server
server:
LW_DEBUG=1 go run .
tag := $(shell git describe --abbrev=0 --tags)
.PHONY: retag
retag:
@echo "Re-setting tag $(tag) to the current commit"
git push origin :$(tag)
git tag -d $(tag)
git tag $(tag)
get_sqlboiler:
go get -u -t github.com/volatiletech/sqlboiler@v3.4.0
go get -u -t github.com/volatiletech/sqlboiler/drivers/sqlboiler-psql@v3.4.0
.PHONY: models
models: get_sqlboiler
sqlboiler --add-global-variants --wipe psql --no-context
.PHONY: api
api:
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build \
-o dist/linux_amd64/lbrytv \
-ldflags "-s -w -X github.com/lbryio/lbrytv/version.version=$(api_version) -X github.com/lbryio/lbrytv/version.commit=$(git_hash) -X github.com/lbryio/lbrytv/apps/version.buildDate=$(date)" \
.
watchman:
GOARCH=amd64 GOOS=linux go build \
-o apps/watchman/dist/linux_amd64/watchman \
-ldflags "-s -w -X github.com/lbryio/lbrytv/version.version=$(watchman_version) -X github.com/lbryio/lbrytv/version.commit=$(git_hash) -X github.com/lbryio/lbrytv/apps/version.buildDate=$(date)" \
./apps/watchman/cmd/watchman/
watchman_image:
docker build -t lbry/odysee-watchman:$(watchman_version) ./apps/watchman
watchman_design:
goa gen github.com/lbryio/lbrytv/apps/watchman/design -o apps/watchman
watchman_example:
goa example github.com/lbryio/lbrytv/apps/watchman/design -o apps/watchman