Move start-stop order to single config
Now .services file defines list and order of services to start and stop. Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
parent
959d994ae5
commit
d0cfbcd95a
6 changed files with 10 additions and 6 deletions
7
.services
Normal file
7
.services
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Services start/stop order
|
||||||
|
# Will start from top to bottom and stop in reverse
|
||||||
|
basenet
|
||||||
|
chain
|
||||||
|
morph_chain
|
||||||
|
ir
|
||||||
|
storage
|
5
Makefile
5
Makefile
|
@ -16,12 +16,13 @@ GET_SVCS = $(shell grep -Rl "get.*:" ./services/* | sort -u | grep artifacts.mk
|
||||||
PULL_SVCS = $(shell find ./services -type f -name 'docker-compose.yml' | sort -u | xargs -I {} dirname {} | xargs basename -a)
|
PULL_SVCS = $(shell find ./services -type f -name 'docker-compose.yml' | sort -u | xargs -I {} dirname {} | xargs basename -a)
|
||||||
|
|
||||||
# Sorted services for running
|
# Sorted services for running
|
||||||
START_SVCS = $(shell find ./services -type f -name '.order' | xargs -I % /bin/bash -c 'echo "$$(cat %) %"' | sort -u | awk '{ print $$2 }' | xargs -I {} dirname {} | xargs basename -a)
|
START_SVCS = $(shell cat .services | grep -v \\\#)
|
||||||
STOP_SVCS = $(shell find ./services -type f -name '.order' | xargs -I % /bin/bash -c 'echo "$$(cat %) %"' | sort -ur | awk '{ print $$2 }' | xargs -I {} dirname {} | xargs basename -a)
|
STOP_SVCS = $(shell tac .services | grep -v \\\#)
|
||||||
|
|
||||||
# List of available sites
|
# List of available sites
|
||||||
HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts)
|
HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts)
|
||||||
|
|
||||||
|
|
||||||
# Pull all required Docker images
|
# Pull all required Docker images
|
||||||
.PHONY: pull
|
.PHONY: pull
|
||||||
pull:
|
pull:
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
01
|
|
|
@ -1 +0,0 @@
|
||||||
02
|
|
|
@ -1 +0,0 @@
|
||||||
04
|
|
|
@ -1 +0,0 @@
|
||||||
03
|
|
Loading…
Reference in a new issue