forked from Joystream/orion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (59 loc) · 2.17 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
process: migrate
@SQD_DEBUG=sqd:processor:mapping node -r dotenv-expand/config lib/processor.js
install:
@rm -rf node_modules # clean up node_modules to avoid issues with patch-package
@rm -rf network-tests/node_modules # clean up node_modules to avoid issues with patch-package
@npm install
build:
@npm run build
build-docker:
@docker build . -t joystream/orion
serve:
@npm run graphql-server-start
serve-auth-api:
@npm run auth-server-start
migrate:
@npx squid-typeorm-migration apply
dbgen:
@npx squid-typeorm-migration generate
generate-migrations:
@docker run -d --name temp_migrations_db \
-e POSTGRES_DB=squid \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v temp_migrations_db_volume:/var/lib/postgresql/data \
-v ./db/postgres.conf:/etc/postgresql/postgresql.conf \
-p 5555:5555 postgres:14 postgres -p 5555 || true
@sleep 5
@export DB_PORT=5555 && npx squid-typeorm-migration apply --filename *-Admin.js
@ls db/migrations > db/migrations_dir_before.txt
@export DB_PORT=5555 && npx squid-typeorm-migration apply --filename *-Data.js
@export DB_PORT=5555 && npx squid-typeorm-migration generate || true
@ls db/migrations > db/migrations_dir_after.txt
@if ! diff db/migrations_dir_before.txt db/migrations_dir_after.txt > /dev/null ; then \
rm db/migrations/*-Views.js; \
node db/generateViewsMigration.js; \
fi;
@docker rm temp_migrations_db -vf || true
@docker volume rm temp_migrations_db_volume || true
@rm db/migrations_dir_before.txt db/migrations_dir_after.txt || true
codegen:
@npm run generate:schema || true
@npx squid-typeorm-codegen
network-tests:
@npm run generate:network-tests || true
typegen:
@npx squid-substrate-typegen typegen.json
prepare: install typegen codegen build
up-squid:
@docker network create joystream_default || true
@docker-compose up -d
up-archive:
@docker network create joystream_default || true
@docker-compose -f archive/docker-compose.yml up -d
up: up-archive up-squid
down-squid:
@docker-compose down -v
down-archive:
@docker-compose -f archive/docker-compose.yml down -v
down: down-squid down-archive
.PHONY: build serve process migrate codegen typegen prepare up-squid up-archive up down-squid down-archive down