-
Notifications
You must be signed in to change notification settings - Fork 44
/
Makefile.test
84 lines (63 loc) · 2.63 KB
/
Makefile.test
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
ifndef DCL_VERSION
DCL_VERSION := $(shell echo $(shell git describe --tags --always) | sed 's/^v//')
endif
ifndef DCL_COMMIT
DCL_COMMIT := $(shell git log -1 --format='%H')
endif
UID := $(shell id -u)
#GID := $(shell id -g)
LOCALNET_DIR ?= .localnet
LOCALNET_DOCKER_NETWORK = "distributed-compliance-ledger_localnet"
IMAGE_NAME = "dcledger"
remove_containers = $(if $(1),docker rm -f $(1),true)
localnet_containers = $(shell docker ps --format '{{.ID}}' --filter network=$(LOCALNET_DOCKER_NETWORK))
clean_network = $(call remove_containers,$(call localnet_containers))
MAINNET_STABLE_VERSION="v0.12.0"
# test deploy vars
TEST_DEPLOY_GVN = "test_deploy_gvn"
TEST_DEPLOY_VN = "test_deploy_vn"
TEST_DEPLOY_ON = "test_deploy_on"
image:
docker build -t ${IMAGE_NAME} --build-arg TEST_UID=${UID} \
--build-arg DCL_VERSION=${DCL_VERSION} --build-arg DCL_COMMIT=${DCL_COMMIT} .
localnet_init:
/bin/bash ./genlocalnetconfig.sh
/bin/bash ./genlocalnetappbins.sh
localnet_init_latest_stable_release:
/bin/bash ./genlocalnetconfig.sh ${MAINNET_STABLE_VERSION}
/bin/bash ./genlocalnetappbins.sh "" "" "" ${MAINNET_STABLE_VERSION}
localnet_start:
@if [ -d "${LOCALNET_DIR}/observer0" ]; then\
docker compose --profile observers up -d;\
else\
docker compose up -d;\
fi
localnet_stop:
docker compose down || ($(call clean_network) && docker compose down)
localnet_export: localnet_stop
docker compose run node0 dcld export --for-zero-height >genesis.export.node0.json
docker compose run node1 dcld export --for-zero-height >genesis.export.node1.json
docker compose run node2 dcld export --for-zero-height >genesis.export.node2.json
docker compose run node3 dcld export --for-zero-height >genesis.export.node3.json
@if [ -d "${LOCALNET_DIR}/observer0" ]; then\
docker compose run observer0 dcld export --for-zero-height >genesis.export.observer0.json;\
fi
localnet_reset: localnet_stop
docker compose run node0 dcld unsafe-reset-all
docker compose run node1 dcld unsafe-reset-all
docker compose run node2 dcld unsafe-reset-all
docker compose run node3 dcld unsafe-reset-all
@if [ -d "${LOCALNET_DIR}/observer0" ]; then\
docker compose run observer0 dcld unsafe-reset-all;\
fi
localnet_clean: localnet_stop
rm -rf $(LOCALNET_DIR)
rm -rf $(HOME)/.dcl
localnet_rebuild: localnet_clean localnet_init
test_deploy_env_build:
docker compose -f integration_tests/deploy/docker-compose.yml up -d
test_deploy_env_clean:
docker compose -f integration_tests/deploy/docker-compose.yml down
.PHONY: localnet_init localnet_start localnet_stop localnet_clean localnet_export \
localnet_reset localnet_rebuild \
test_deploy_env_build test_deploy_env_clean \