forked from TrueCloudLab/frostfs-dev-env
Make up/down
for services (#155)
* [#155] s3_gate: Service name in docker-compose.yml Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru> * [#155] Makefile: Make Up/Down certain services Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru> * [#155] Makefile: minor fixes Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru> Co-authored-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
parent
07bd61f78e
commit
3348ebbfe0
4 changed files with 39 additions and 9 deletions
7
.basic_services
Normal file
7
.basic_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
|
|
@ -1,10 +1,5 @@
|
|||
# Services start/stop order
|
||||
# Will start from top to bottom and stop in reverse
|
||||
basenet
|
||||
chain
|
||||
morph_chain
|
||||
ir
|
||||
storage
|
||||
http_gate
|
||||
s3_gate
|
||||
coredns
|
||||
|
|
34
Makefile
34
Makefile
|
@ -27,7 +27,9 @@ PULL_SVCS = $(shell find ./services -type f -name 'docker-compose.yml' | sort -u
|
|||
|
||||
# List of services to run
|
||||
START_SVCS = $(shell cat .services | grep -v \\\#)
|
||||
START_BASIC = $(shell cat .basic_services | grep -v \\\#)
|
||||
STOP_SVCS = $(shell tac .services | grep -v \\\#)
|
||||
STOP_BASIC = $(shell tac .basic_services | grep -v \\\#)
|
||||
|
||||
# List of hosts available in devenv
|
||||
HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts)
|
||||
|
@ -52,17 +54,43 @@ get: $(foreach SVC, $(GET_SVCS), get.$(SVC))
|
|||
|
||||
# Start environment
|
||||
.PHONY: up
|
||||
up: get vendor/hosts
|
||||
up: up/basic
|
||||
@$(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d))
|
||||
@echo "Full NeoFS Developer Environment is ready"
|
||||
|
||||
# Build up NeoFS
|
||||
.PHONY: up/basic
|
||||
up/basic: get vendor/hosts
|
||||
@$(foreach SVC, $(START_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d))
|
||||
@./bin/tick.sh
|
||||
@./bin/config.sh string SystemDNS container
|
||||
@echo "NeoFS Developer Environment is ready"
|
||||
@echo "Basic NeoFS Developer Environment is ready"
|
||||
|
||||
# Build up certain service
|
||||
.PHONY: up/%
|
||||
up/%: get vendor/hosts
|
||||
@docker-compose -f services/$*/docker-compose.yml up -d
|
||||
@echo "Developer Environment for $* service is ready"
|
||||
|
||||
# Stop environment
|
||||
.PHONY: down
|
||||
down:
|
||||
down: down/add down/basic
|
||||
@echo "Full NeoFS Developer Environment is down"
|
||||
|
||||
.PHONY: down/add
|
||||
down/add:
|
||||
$(foreach SVC, $(STOP_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down))
|
||||
|
||||
# Stop basic environment
|
||||
.PHONY: down/basic
|
||||
down/basic:
|
||||
$(foreach SVC, $(STOP_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down))
|
||||
|
||||
# Stop certain service
|
||||
.PHONY: down/%
|
||||
down/%:
|
||||
@docker-compose -f services/$*/docker-compose.yml down
|
||||
|
||||
.PHONY: vendor/hosts
|
||||
.ONESHELL:
|
||||
vendor/hosts:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
version: "2.4"
|
||||
services:
|
||||
http_gate:
|
||||
s3_gate:
|
||||
image: ${S3_GW_IMAGE}:${S3_GW_VERSION}
|
||||
domainname: ${LOCAL_DOMAIN}
|
||||
hostname: s3_gate
|
||||
|
|
Loading…
Reference in a new issue