-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (56 loc) · 2.62 KB
/
Makefile
File metadata and controls
74 lines (56 loc) · 2.62 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
64
65
66
67
68
69
70
71
72
73
74
git_hook_setup = cp .githooks/pre-commit .git/hooks/pre-commit
git_diff_to_master = git diff --name-only --diff-filter=ACMRTUXB origin/master > DIFF
create_test_paybutton_json = echo { \"priceAPIURL\": \"foo\", \"networkBlockchainClients\": { \"ecash\": \"chronik\", \"bitcoincash\": \"chronik\" }, \"networkBlockchainURLs\": { \"ecash\": [\"https://xec.paybutton.io\"], \"bitcoincash\": [\"https://bch.paybutton.io\"] }, \"wsBaseURL\": \"http://localhost:5000\", \"apiDomain\": \"http://localhost:3000\", \"proSettings\": { \"enabled\": true, \"monthsCost\": { \"1\": 10, \"3\": 20, \"6\": 30, \"12\": 50 }, \"payoutAddress\": \"ecash:qrf4zh4vgrdal8d8gu905d90w5u2y60djcd2d5h6un\", \"standardDailyEmailLimit\": 5, \"proDailyEmailLimit\": 100, \"standardDailyPostLimit\": 5, \"proDailyPostLimit\": 100, \"standardAddressesPerButtonLimit\": 20, \"proAddressesPerButtonLimit\": \"Inf\" } } > paybutton-config.json
touch_local_env = touch .env.local
prod:
$(git_hook_setup)
$(touch_local_env)
docker compose -f docker-compose-prod.yml --env-file .env --env-file .env.local up --build -d
stop-prod:
docker compose -f docker-compose-prod.yml down
reset-prod:
make stop-prod && make prod
deploy:
git pull && make reset-prod && make logs-dev
dev:
$(git_hook_setup)
$(touch_local_env)
docker compose --env-file .env --env-file .env.local up --build -d
stop-dev:
docker compose down
reset-dev:
make stop-dev && make dev
reset-dev-keep-db:
docker container restart paybutton-dev
dev-from-dump:
make stop-dev
$(git_hook_setup)
$(touch_local_env)
docker compose -f docker-compose-from-dump.yml --env-file .env --env-file .env.local --env-file .env.from-dump up --build -d
logs-dev:
docker logs -f paybutton-dev
logs-db:
docker logs -f paybutton-db
logs-cache:
docker logs -f paybutton-cache
logs-users:
docker logs -f paybutton-users-service
lint:
yarn eslint .
no-isolated-tests:
grep -rEn '(describe|it)\.only' tests/* && exit 1 || echo No isolated tests.
lint-master:
$(git_diff_to_master)
yarn eslint --stdin --stdin-filename DIFF
# WARNING: this shouldn't be run on local machine, only on github. It will replace your config file
github-test-unit:
$(create_test_paybutton_json)
$(touch_local_env)
MASTER_SECRET_KEY="test" WS_AUTH_KEY="test" PRICE_API_TOKEN="foo" npx ts-node -O '{"module":"commonjs"}' node_modules/jest/bin/jest.js tests/unittests --forceExit
# WARNING: this shouldn't be run on local machine, only on github. It will replace your config file
github-test-integration:
sleep 15
$(create_test_paybutton_json)
$(touch_local_env)
sed -i "s/MAIN_DB_HOST=paybutton-db/MAIN_DB_HOST=localhost/g" .env.test
yarn ci:integration:test