This repository has been archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
105 lines (73 loc) · 3.11 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
103
104
105
all:
trap 'kill %1' SIGINT; make run-internal & bash -c 'sleep 1 && make run'
split:
tmux new-session 'make run-internal' \; split-window 'sleep 1 && make run' \;
install:
npm i
build:
npm run build
run:
npm run start
run-internal:
npm run start-internal
run-admin:
npm run start-admin
test:
npm run transpile
npm test
test-system:
npm run test-system
console:
node --experimental-repl-await ./scripts/bin/node-console.js
# will connect to localhost:3000 via socket (can be used to connect to prod with ssh tunnel or any environment)
console-admin:
npm run remote-repl
# "make down up" will not work sometimes, adding sleep after "down" fixes it
sleep:
sleep 0.5
# docker targets
revision := $(shell git rev-parse --short HEAD)
image := "kinecosystem/marketplace-server"
build-image: create-jwt-keys
docker build -t ${image} -f Dockerfile \
--build-arg BUILD_COMMIT="${revision}" \
--build-arg BUILD_TIMESTAMP="$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")" .
docker tag ${image} ${image}:${revision}
push-image:
docker push ${image}:latest
docker push ${image}:${revision}
pull:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml pull
up: up-dev
up-dev: db-docker
. ./secrets/.secrets && docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml up -d
logs:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml logs
down:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml down
psql:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm psql
redis-cli:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm redis-cli
db: db-docker
db-docker:
. ./secrets/.secrets && docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm create-db
clear-db:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm psql -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO public;"
clear-redis:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm redis-cli del cursor
test-system-docker:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm test-system
generate-funding-address:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run generate-funding-address
console-docker:
docker-compose -f docker-compose.yaml -f docker-compose.deps.yaml -f docker-compose.tests.yaml run --rm marketplace-console
create-jwt-keys:
./operational/create_keys.sh .
clean-source:
find ./scripts/src -name "*.d.ts" -exec rm {} \;
find ./scripts/src -name "*.js" -exec rm {} \;
find ./scripts/src -name "*.js.map" -exec rm {} \;
find ./tests/src -name "*.d.ts" -exec rm {} \;
find ./tests/src -name "*.js.map" -exec rm {} \;
.PHONY: build-image push-image up down psql db-docker test-system-docker generate-funding-address test run build install db all split run-internal test-system