-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
102 lines (78 loc) · 2.95 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.PHONY: build
build: build-node build-reverse-proxy build-node-mongo;
.PHONY: build-node
build-node:
docker build . --build-arg RESET_DOCKER_CACHE="$$(date)" --target=node -t node:current
.PHONY: build-reverse-proxy
build-reverse-proxy:
docker build . --target=node-reverse-proxy -t node-reverse-proxy:current
.PHONY: build-node-mongo
build-node-mongo:
DOCKER_BUILDKIT=1 docker build . --target=node-mongo -t node-mongo:current
.PHONY: up-dependencies-only
up-dependencies-only: build-node-mongo
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --force-recreate node-mongo mongo-express celery-broker
.PHONY: up
up:
docker-compose -f docker-compose.yml up --force-recreate
.PHONY: up-dev
up-dev: build
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --force-recreate
.PHONY: test
test:
TNB_FOR_UNITTESTS_DISREGARD_OTHERWISE='{"test": 1}' poetry run pytest -v -rs -n auto --cov=node --cov-report=html --show-capture=no
.PHONY: test-stepwise
test-stepwise:
poetry run pytest --reuse-db --sw -vv --show-capture=no
.PHONY: install
install:
poetry install
.PHONY: migrate
migrate:
poetry run python -m node.manage migrate
.PHONY: install-pre-commit
install-pre-commit:
poetry run pre-commit uninstall; poetry run pre-commit install
.PHONY: update
update: install migrate install-pre-commit ;
.PHONY: superuser
superuser:
poetry run python -m node.manage createsuperuser
.PHONY: run-server
run-server:
poetry run python -m node.manage runserver 127.0.0.1:8555
.PHONY: run-celery
run-celery:
poetry run celery -A node.config.celery worker --loglevel=INFO
.PHONY: shell
shell:
poetry run python -m node.manage shell
.PHONY: lint
lint:
poetry run pre-commit run --all-files
.PHONY: lint-and-test
lint-and-test: lint test ;
.PHONY: migrations
migrations:
poetry run python -m node.manage makemigrations
.PHONY: genesis
genesis:
# Test money
# Private: a37e2836805975f334108b55523634c995bd2a4db610062f404510617e83126e
# Public: 2e8c94aa1b8de49c41407fc3fce36785f56d6983ea6777dd9c7b25bfec95e4fc
poetry run python -m node.manage genesis -f -e 2e8c94aa1b8de49c41407fc3fce36785f56d6983ea6777dd9c7b25bfec95e4fc https://raw.githubusercontent.com/thenewboston-developers/Account-Backups/master/latest_backup/latest.json
.PHONY: clear-blockchain
clear-blockchain:
poetry run python -m node.manage clear_blockchain
.PHONY: sync-blockchain-with-network
sync-blockchain-with-network:
poetry run python -m node.manage sync_blockchain_with_network
.PHONY: ensure-node-declared
ensure-node-declared:
poetry run python -m node.manage ensure_node_declared
.PHONY: dot-env
dot-env:
test -f .env || touch .env
grep -q -o MONGO_INITDB_ROOT_PASSWORD .env || echo "MONGO_INITDB_ROOT_PASSWORD=$$(xxd -l 16 -p /dev/urandom)" >> .env
grep -q -o TNB_SECRET_KEY .env || echo "TNB_SECRET_KEY=$$(xxd -c 48 -l 48 -p /dev/urandom)" >> .env
grep -q -o TNB_NODE_SIGNING_KEY .env || echo "TNB_NODE_SIGNING_KEY=$$(poetry run python -m node.manage generate_signing_key)" >> .env