This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
64 lines (52 loc) · 1.64 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
ETCD_CLUSTER_DOCKER_COMPOSE ?= etcd-docker-compose.yaml
ETCD_CLUSTER_WITH_TLS ?= false
ETCD_NODE ?= etcd-1
ETCD_VERSION ?= v3.5.2
TEST_CASE ?= test_basic
.PHONY: build
build:
cargo build
.PHONY: test
test:
cargo nextest run --test-threads=1 --retries 5
cargo check --no-default-features
.PHONY: test-one
test-one:
cargo nextest run --test ${TEST_CASE} --test-threads=1
.PHONY: publish
publish:
cargo package && cargo publish
.PHONY: setup-etcd-cluster
setup-etcd-cluster: teardown-etcd-cluster
ifneq ("${ETCD_CLUSTER_WITH_TLS}", "false")
./hack/generate_etcd_certificate.sh
endif
./hack/generate_etcd_cluster.sh ${ETCD_CLUSTER_DOCKER_COMPOSE} ${ETCD_VERSION} ${ETCD_CLUSTER_WITH_TLS}
docker-compose -f ${ETCD_CLUSTER_DOCKER_COMPOSE} up -d
.PHONY: start-etcd-node
start-etcd-node:
ifneq ("$(wildcard ${ETCD_CLUSTER_DOCKER_COMPOSE})","")
docker-compose -f ${ETCD_CLUSTER_DOCKER_COMPOSE} start ${ETCD_NODE}
endif
.PHONY: stop-etcd-node
stop-etcd-node:
ifneq ("$(wildcard ${ETCD_CLUSTER_DOCKER_COMPOSE})","")
docker-compose -f ${ETCD_CLUSTER_DOCKER_COMPOSE} stop ${ETCD_NODE}
endif
.PHONY: teardown-etcd-cluster
teardown-etcd-cluster:
ifneq ("$(wildcard ${ETCD_CLUSTER_DOCKER_COMPOSE})","")
docker-compose -f ${ETCD_CLUSTER_DOCKER_COMPOSE} down
rm ${ETCD_CLUSTER_DOCKER_COMPOSE}
endif
etcd/etcdctl:
./hack/download_etcd.sh
.PHONY: etcd-cluster-status
etcd-cluster-status: etcd/etcdctl
ifneq ("$(wildcard ${ETCD_CLUSTER_DOCKER_COMPOSE})","")
docker-compose -f ${ETCD_CLUSTER_DOCKER_COMPOSE} ps;
etcd/etcdctl endpoint status --endpoints=127.0.0.1:12379,127.0.0.1:22379,127.0.0.1:32379 -w table;
endif
.PHONY: clean
clean: teardown-etcd-cluster
cargo clean