forked from steemit/hivemind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (42 loc) · 1.47 KB
/
Makefile
File metadata and controls
63 lines (42 loc) · 1.47 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
SHELL := /bin/bash
ROOT_DIR := $(shell pwd)
PROJECT_NAME := hive
PROJECT_DOCKER_TAG := steemit/$(PROJECT_NAME)
PROJECT_DOCKER_RUN_ARGS := --link mysql:mysql
default: build
.PHONY: test run test-without-lint test-pylint fmt test-without-build build
build:
docker build -t $(PROJECT_DOCKER_TAG) .
run:
docker run -it $(PROJECT_DOCKER_RUN_ARGS) $(PROJECT_DOCKER_TAG) /bin/bash
compose:
docker-compose up -d
mysql:
docker run -d --name steemit_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root_password -e MYSQL_DATABASE=testdb mysql
serve-local:
pipenv run python hive/server/serve.py --port 8080 --database_url='mysql://root:root_password@127.0.0.1:3306/testdb'
.PHONY: db-head-state
db-head-state:
curl -H 'Content-Type: application/json' -d '{"id":1,"jsonrpc":"2.0","method":"db_head_state"}' http://localhost:8080
ipython:
docker run -it $(PROJECT_DOCKER_RUN_ARGS) $(PROJECT_DOCKER_TAG) ipython
test: test-without-build build
test-without-build: test-without-lint test-pylint
test-without-lint:
py.test tests
test-pylint:
py.test --pylint -m pylint $(PROJECT_NAME)
fmt:
yapf --recursive --in-place --style pep8 .
autopep8 --recursive --in-place .
requirements.txt: serve.py
pip freeze > $@
clean: clean-build clean-pyc
clean-build:
rm -fr build/ dist/ *.egg-info .eggs/ .tox/ __pycache__/ .cache/ .coverage htmlcov src
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
install: clean
pip install -e .