From 55c1add70c8e71f1f634bdff460ee7717f59eb50 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 14 Oct 2022 12:39:30 +0300 Subject: [PATCH] [#225] makefile: pull only enabled services Signed-off-by: Denis Kirillov --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7e7815a..d3dc47b 100644 --- a/Makefile +++ b/Makefile @@ -19,12 +19,6 @@ include services/*/artifacts.mk # Targets helpful to prepare service environment include services/*/prepare.mk -# Services that require artifacts -GET_SVCS = $(shell grep -Rl "get.*:" ./services/* | sort -u | grep artifacts.mk | xargs -I {} dirname {} | xargs basename -a) - -# Services that require pulling images -PULL_SVCS = $(shell find ./services -type f -name 'docker-compose.yml' | sort -u | xargs -I {} dirname {} | xargs basename -a) - # List of services to run START_SVCS = $(shell cat .services | grep -v \\\#) START_BASIC = $(shell cat .basic_services | grep -v \\\#) @@ -33,6 +27,15 @@ STOP_SVCS = $(shell tac .services | grep -v \\\#) STOP_BASIC = $(shell tac .basic_services | grep -v \\\#) STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v \\\#) +# Enabled services dirs +ENABLED_SVCS_DIRS = $(shell echo "${START_BOOTSTRAP} ${START_BASIC} ${START_SVCS}" | sed 's|[^ ]* *|./services/&|g') + +# Services that require artifacts +GET_SVCS = $(shell grep -Rl "get.*:" ./services/* | sort -u | grep artifacts.mk | xargs -I {} dirname {} | xargs basename -a) + +# Services that require pulling images +PULL_SVCS = $(shell find ${ENABLED_SVCS_DIRS} -type f -name 'docker-compose.yml' | sort -u | xargs -I {} dirname {} | xargs basename -a) + # List of hosts available in devenv HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts)