-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 1.28 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
IMAGE ?= ghcr.io/bacalhau-project/lotus-filecoin-image
TAG ?= latest
LOTUS_TAG := v1.17.2
.PHONY: build
build:
docker build --build-arg BRANCH=$(LOTUS_TAG) --tag $(IMAGE):$(TAG) .
.PHONY: test
test:
TEST_IMAGE=$(IMAGE):$(TAG) go test -count=1 -v ./tests/...
.PHONY: push
push:
docker push $(IMAGE):$(TAG)
.PHONY: run
run:
docker run --tty --detach --publish 1234:1234 --volume ${PWD}/testdata:/home/lotus_user/testdata --name lotus $(IMAGE):$(TAG)
.PHONY: bash
bash:
docker exec --interactive --tty $(shell docker ps --quiet --filter=label=network=local --filter=label=filecoin=lotus) /bin/bash
.PHONY: status
status:
docker exec --interactive --tty $(shell docker ps --quiet --filter=label=network=local --filter=label=filecoin=lotus) lotus sync status
.PHONY: token
token:
docker exec --interactive --tty $(shell docker ps --quiet --filter=label=network=local --filter=label=filecoin=lotus) bash -c "cat ~/.lotus-local-net/token"
.PHONY: log
log:
docker logs --follow $(shell docker ps --quiet --filter=label=network=local --filter=label=filecoin=lotus) 2>&1
.PHONY: clean
clean:
docker ps --quiet --filter=label=network=local --filter=label=filecoin=lotus | xargs docker stop
docker ps --all --quiet --filter=label=network=local --filter=label=filecoin=lotus | xargs docker rm --volumes