This repository has been archived by the owner on Feb 15, 2021. It is now read-only.
forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
141 lines (98 loc) · 3.15 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#export FPCO_CI_REGISTRY_IMAGE ?= registry.gitlab.fpcomplete.com/chrisallen/totto
#export CI_REGISTRY_IMAGE ?= registry.gitlab.com/bitemyapp/totto
#export FPCO_DOCKER_IMAGE ?= ${FPCO_CI_REGISTRY_IMAGE}:latest
#export KUBE_SPEC = etc/kubernetes/totto.yaml
#export DOCKER_IMAGE ?= ${CI_REGISTRY_IMAGE}:latest
export CI_PIPELINE_ID ?= $(shell date +"%Y-%m-%d-%s")
export SERVER_DOCKER_IMAGE ?= gluk64/franklin:server
export PROVER_DOCKER_IMAGE ?=gluk64/franklin:prover
export GETH_DOCKER_IMAGE ?= gluk64/franklin:geth
docker-options = --rm -v $(shell pwd):/home/rust/src -v cargo-git:/home/rust/.cargo/git -v cargo-registry:/home/rust/.cargo/registry
rust-musl-builder = @docker run $(docker-options) -it ekidd/rust-musl-builder
sql = psql $(DATABASE_URL) -c
confirm_action:
@bin/.confirm_action
# Scripts (for shell autocomplete)
env:
@bin/env
db-test:
@bin/db-test
db-setup: confirm_action
@bin/db-setup
init: dev-up env yarn db-setup redeploy
yarn:
@cd contracts; yarn
@cd js/franklin; yarn
@cd js/client; yarn
@cd js/loadtest; yarn
@cd js/explorer; yarn
client:
@cd js/client; yarn dev
explorer:
@cd js/explorer; yarn dev
prover:
@bin/.load_keys; cargo run --release --bin prover
server:
@cargo run --release --bin server
sandbox:
@cd src/sandbox; cargo run
deploy-contracts: confirm_action
@bin/deploy-contracts
deploy-client: confirm_action
@bin/deploy-client
db-reset: confirm_action db-drop db-setup
redeploy: deploy-contracts db-reset
db-drop: confirm_action
@# this is used to clear the produciton db; cannot do `diesel database reset` because we don't own the db
@echo DATABASE_URL=$(DATABASE_URL)
@$(sql) 'DROP OWNED BY CURRENT_USER CASCADE' || \
{ $(sql) 'DROP SCHEMA IF EXISTS public CASCADE' && $(sql)'CREATE SCHEMA public'; }
build-target:
$(rust-musl-builder) cargo build --release
clean-target:
$(rust-musl-builder) cargo clean
server-image: build-target
docker build -t "${SERVER_DOCKER_IMAGE}" -f ./docker/server/Dockerfile .
prover-image: build-target
docker build -t "${PROVER_DOCKER_IMAGE}" -f ./docker/prover/Dockerfile .
images: server-image prover-image
push: images
docker push gluk64/franklin:server
docker push gluk64/franklin:prover
start: images
@docker-compose up -d --scale prover=1 server prover
stop:
@docker-compose stop server prover
status:
@curl $(API_SERVER)/api/v0.1/status; echo
restart: stop start logs
logs:
@docker-compose logs -f server prover
dev-up:
@docker-compose up -d postgres geth
dev-down:
@docker-compose stop postgres geth
geth:
@docker build -t "${GETH_DOCKER_IMAGE}" ./docker/geth
geth-up: geth
@docker-compose up geth
blockscout-migrate:
@docker-compose up -d blockscout_postgres
@docker-compose run blockscout /bin/sh -c "echo $MIX_ENV && mix do ecto.drop --force, ecto.create, ecto.migrate"
blockscout-up:
@docker-compose up -d blockscout_postgres blockscout
blockscout-down:
@docker-compose stop blockscout blockscout_postgres
loadtest:
@cd js/loadtest; yarn test
# Kubernetes
kube-deploy: confirm_action
@bin/deploy-kube
pods:
kubectl get pods -o wide
nodes:
kubectl get nodes -o wide
logs-server:
kubectl logs deployments/server
logs-prover:
kubectl logs deployments/prover