-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (50 loc) · 1.85 KB
/
Makefile
File metadata and controls
68 lines (50 loc) · 1.85 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
app_conf_dir=~/.storechain
# docker_compose=docker-compose
ifeq (, $(shell which docker-compose))
docker_compose=docker compose
else
docker_compose=docker-compose
endif
# Checks two given strings for equality.
eq = $(if $(or $(1),$(2)),$(and $(findstring $(1),$(2)),\
$(findstring $(2),$(1))),1)
#
init:
set -eux
rm -rf ${app_conf_dir}
mkdir -p ${app_conf_dir}/config
echo "pg_url = \"postgresql://pg:pg@localhost:5432/pg\"" > ${app_conf_dir}/config/app_conf.toml
cargo run $(if $(call eq,$(features),),,--features $(features)) -- init test
cargo run $(if $(call eq,$(features),),,--features $(features)) -- add-genesis-account cosmos1syavy2npfyt9tcncdtsdzf7kny9lh777pahuux 34uatom
run:
cargo run $(if $(call eq,$(features),),,--features $(features)) -- run
run-debug:
RUST_LOG=DEBUG cargo run $(if $(call eq,$(features),),,--features $(features)) -- run --verbose
tendermint-start:
tendermint start --home ~/.storechain
db.init:
sqlx migrate run
add.test.acc:
echo "race draft rival universe maid cheese steel logic crowd fork comic easy truth drift tomorrow eye buddy head time cash swing swift midnight borrow" | cargo run $(if $(call eq,$(features),),,--features $(features)) -- keys add alice --recover
test:
cargo test
install:
cargo install --path ${app_conf_dir}
# Docker commands
docker.start:
${docker_compose} up -d
docker.stop:
${docker_compose} down
docker.exec:
${docker_compose} exec app /bin/bash
docker.init:
${docker_compose} exec app make init features=$(features)
docker.run:
${docker_compose} exec app make run features=$(features)
docker.tendermint-start:
${docker_compose} exec app make tendermint-start
docker.db.init:
${docker_compose} exec app make db.init
docker.add.test.acc:
${docker_compose} exec app make add.test.acc features=$(features)
.PHONY: run run-debug test install init tendermint-start