-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (38 loc) · 1.07 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
BINARIES := api indexer
IMAGE=directory
TAG=latest
# MAKEFLAGS += --no-print-directory
.PHONY: clean build $(BINARIES)
build:
go build ./...
clean:
go clean ./...
find . -type f -name 'swagger.json' -exec rm -f {} +
test:
go test ./...
test-unit:
go test -v -short ./...
swagger:
swagger generate spec -o ./docs/swagger.yaml --scan-models
# redoc-cli: install with `npm install -g redoc-cli`
swagger-html: swagger
redoc-cli bundle -o docs/swagger.html docs/swagger.yaml
swagger-serve: swagger
swagger serve -F=swagger swagger.yaml
run-indexer: build
go run cmd/indexer/main.go --env=./docker/dev/local.env
run-api: build
go run cmd/api/main.go --env=./docker/dev/local.env
db-migrate:
tern migrate -c db/tern.conf -m db
lint:
@./scripts/lint.sh
install:
go install ./cmd/...
docker-build: swagger-html
@docker build --platform=linux/amd64 . --file Dockerfile -t ${IMAGE}:${TAG}
docker-tag:
@docker tag ${IMAGE}:${TAG} ghcr.io/arkeonetwork/${IMAGE}:${TAG}
docker-push:
@docker push ghcr.io/arkeonetwork/${IMAGE}:${TAG}
push-image: docker-build docker-tag docker-push