From d0cfbcd95ad5b12e8bc80938aee79030f46a43d0 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 22 Sep 2020 16:08:06 +0300 Subject: [PATCH] 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 --- .services | 7 +++++++ Makefile | 5 +++-- services/basenet/.order | 1 - services/chain/.order | 1 - services/ir/.order | 1 - services/morph_chain/.order | 1 - 6 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .services delete mode 100644 services/basenet/.order delete mode 100644 services/chain/.order delete mode 100644 services/ir/.order delete mode 100644 services/morph_chain/.order diff --git a/.services b/.services new file mode 100644 index 0000000..b9134b7 --- /dev/null +++ b/.services @@ -0,0 +1,7 @@ +# Services start/stop order +# Will start from top to bottom and stop in reverse +basenet +chain +morph_chain +ir +storage diff --git a/Makefile b/Makefile index 339d5f2..b47c1a9 100644 --- a/Makefile +++ b/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) # 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) -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) +START_SVCS = $(shell cat .services | grep -v \\\#) +STOP_SVCS = $(shell tac .services | grep -v \\\#) # List of available sites HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) + # Pull all required Docker images .PHONY: pull pull: diff --git a/services/basenet/.order b/services/basenet/.order deleted file mode 100644 index 8a0f05e..0000000 --- a/services/basenet/.order +++ /dev/null @@ -1 +0,0 @@ -01 diff --git a/services/chain/.order b/services/chain/.order deleted file mode 100644 index 9e22bcb..0000000 --- a/services/chain/.order +++ /dev/null @@ -1 +0,0 @@ -02 diff --git a/services/ir/.order b/services/ir/.order deleted file mode 100644 index 6496923..0000000 --- a/services/ir/.order +++ /dev/null @@ -1 +0,0 @@ -04 diff --git a/services/morph_chain/.order b/services/morph_chain/.order deleted file mode 100644 index 75016ea..0000000 --- a/services/morph_chain/.order +++ /dev/null @@ -1 +0,0 @@ -03