-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
248 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
.PHONY: all setup lint harvester test image-build image-push | ||
.PHONY: all setup lint ingester test image-build image-push | ||
|
||
APPLICATION := harvester | ||
APPLICATION := ingester | ||
GITHUB_SHA ?= HEAD | ||
REF_TAG := $(shell echo ${GITHUB_REF_NAME} | tr -cd '[:alnum:]') | ||
IMAGE_TAG := ${ECR_REGISTRY}/${ECR_REPOSITORY}:${REF_TAG}-$(shell git rev-parse --short "${GITHUB_SHA}")-${GITHUB_RUN_NUMBER} | ||
TEST_TIMEOUT := 10s | ||
|
||
all: lint test harvester | ||
all: lint test ingester | ||
|
||
setup: bin/golangci-lint bin/gofumpt | ||
setup: bin/golangci-lint bin/gofumpt bin/moq | ||
go mod download | ||
|
||
bin/moq: | ||
GOBIN=$(PWD)/bin go install github.com/matryer/[email protected] | ||
bin/golangci-lint: | ||
GOBIN=$(PWD)/bin go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
bin/gofumpt: bin | ||
GOBIN=$(PWD)/bin go install mvdan.cc/[email protected] | ||
|
||
harvester: lint cmd/main.go | ||
go build -o harvester cmd/main.go | ||
ingester: lint cmd/main.go | ||
go build -o ingester cmd/main.go | ||
|
||
lint: bin/golangci-lint bin/gofumpt | ||
go fmt ./... | ||
|
@@ -30,12 +32,17 @@ test: | |
go mod tidy | ||
go test -timeout=$(TEST_TIMEOUT) -race -bench=. -benchmem -cover ./... | ||
|
||
gen-mocks: bin/moq ./client/jsonrpc/ ./client/duneapi/ | ||
./bin/moq -pkg jsonrpc_mock -out ./mocks/jsonrpc/rpcnode.go ./client/jsonrpc BlockchainClient | ||
./bin/moq -pkg duneapi_mock -out ./mocks/duneapi/client.go ./client/duneapi BlockchainIngester | ||
|
||
|
||
image-build: | ||
@echo "# Building harvester docker image..." | ||
@echo "# Building ingester docker image..." | ||
docker build -t $(APPLICATION) -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . | ||
|
||
image-push: image-build | ||
@echo "# Pushing harvester docker image..." | ||
@echo "# Pushing ingester docker image..." | ||
docker tag $(APPLICATION) ${IMAGE_TAG} | ||
docker push ${IMAGE_TAG} | ||
docker rmi ${IMAGE_TAG} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.