-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (74 loc) · 2.45 KB
/
Copy pathMakefile
File metadata and controls
97 lines (74 loc) · 2.45 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
DEV_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ROOT_DIR := $(abspath $(DEV_DIR)/..)
ENV_FILE := $(DEV_DIR)/.env
COMPOSE := docker compose --env-file $(ENV_FILE) --project-directory $(ROOT_DIR) -f $(DEV_DIR)/docker-compose.yml
TOOLS_RUN := $(COMPOSE) run --rm tools
.PHONY: \
init ingestion-up ingestion-restart ingestion-stop \
db-up db-restart db-stop down \
install build lint test test-all db-init lint-fix test-coverage test-unit-coverage test-watch test-integration test-e2e test-live-rpc
# Инициализация.
init: install build db-init
# Установить зависимости в контейнере.
install:
$(TOOLS_RUN) npm ci
# Инициализировать схему БД.
db-init: db-up
$(TOOLS_RUN) npm run db:apply-sql -- src/sql/postgres-schema.sql
# Поднять контейнер с базой данных.
db-up:
$(COMPOSE) up -d --wait postgres
# Рестарт контейнера с базой данных.
db-restart:
$(COMPOSE) restart postgres
# Остановить контейнер с базой данных.
db-stop:
$(COMPOSE) stop postgres
# Поднять ingestion окружение.
ingestion-up:
$(COMPOSE) up -d head fetch sequencer retention
# Рестарт ingestion окружения.
ingestion-restart:
$(COMPOSE) up -d --force-recreate head fetch sequencer retention
# Остановить ingestion окружение.
ingestion-stop:
$(COMPOSE) stop head fetch sequencer retention
# Удалить контейнеры и тома.
down:
$(COMPOSE) down -v
# Собрать проект.
build:
$(TOOLS_RUN) npm run build
# Собрать тесты.
build-test:
$(TOOLS_RUN) npm run build-test
# Проверить линтер.
lint:
$(TOOLS_RUN) npm run lint
# Автоисправления линтера.
lint-fix:
$(TOOLS_RUN) npm run lint:fix
# Запустить все тесты.
test-all:
$(TOOLS_RUN) npm run test:all
# Запустить unit-тесты.
test:
$(TOOLS_RUN) npm test
# Integration-тесты.
test-integration:
$(TOOLS_RUN) npm run test:integration
# E2E-тесты.
test-e2e:
$(TOOLS_RUN) npm run test:e2e
# Live RPC-тесты.
test-live-rpc:
$(TOOLS_RUN) npm run test:live-rpc
# Тесты с покрытием.
test-coverage:
$(TOOLS_RUN) npm run test:coverage
# Unit-тесты с покрытием.
test-unit-coverage:
$(TOOLS_RUN) npm run test:unit:coverage
# Тесты в watch-режиме.
test-watch:
$(TOOLS_RUN) npm run test:watch