forked from digitalis-io/postgresql-consul-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (27 loc) · 1.1 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
build:
@echo "Pull and build container images. This make take some time when running for first time."
@docker-compose build
start:
@echo "Start cluster"
@docker-compose up -d --remove-orphans
stop:
@echo "Stop cluster"
@docker-compose stop
destroy:
@echo "Force destroy cluster"
@docker-compose down --remove-orphans
recreate:
@echo "Destroy and recreate cluster"
@docker-compose stop && docker-compose rm -f && docker-compose up -d --remove-orphans
status:
@echo "============================== Docker status =============================="
@docker-compose ps
@printf "\n============================== Consul status ==============================\n"
@docker-compose exec consul01 consul members 2>/dev/null
@printf "\n============================== Patroni status =============================\n"
@docker-compose exec patroni01 patronictl -c /etc/patroni/postgres.yml list 2>/dev/null
switchover:
@echo "Force patroni switchover to another node"
@docker-compose exec patroni01 patronictl -c /etc/patroni/postgres.yml switchover --force
applogs:
@docker-compose logs -f application01 application02