some markup fixes.

This commit is contained in:
Grigory Antsiferov 2016-07-15 15:08:05 +03:00
parent 7852669114
commit d8fb08361b

View File

@ -7,7 +7,7 @@ which = $(if $(shell which $(1) 2>/dev/null),\
DOCKER = $(call which,docker)
DOCKER_COMPOSE = $(call which,docker-compose)
UTIL_TARGETS := to_dev_container w_container_% run_w_container_% check_w_container_%
UTIL_TARGETS := to_dev_container w_container_% w_compose_% run_w_container_% check_w_container_%
ifndef RELNAME
$(error RELNAME is not set)
@ -18,31 +18,29 @@ $(error CALL_W_CONTAINER is not set)
endif
to_dev_container:
$(DOCKER) run -it --rm -v $$PWD:$$PWD --workdir $$PWD $(BASE_IMAGE) /bin/bash
$(DOCKER) run -it --rm -v $$PWD:$$PWD --workdir $$PWD $(BASE_IMAGE) /bin/bash
w_container_%:
$(MAKE) -s run_w_container_$*
$(MAKE) -s run_w_container_$*
w_compose_%:
$(MAKE) -s run_w_compose_$*
$(MAKE) -s run_w_compose_$*
run_w_container_%: check_w_container_%
{ \
$(DOCKER) run --rm -v $$PWD:$$PWD --workdir $$PWD $(BASE_IMAGE) make $* ; \
res=$$? ; \
exit $$res ; \
}
{ \
$(DOCKER) run --rm -v $$PWD:$$PWD --workdir $$PWD $(BASE_IMAGE) make $* ; \
res=$$? ; exit $$res ; \
}
run_w_compose_%: check_w_container_%
{ \
$(DOCKER_COMPOSE) up -d ; \
$(DOCKER_COMPOSE) exec -T $(RELNAME) make $* ; \
res=$$? ; \
$(DOCKER_COMPOSE) down ; \
exit $$res ; \
}
{ \
$(DOCKER_COMPOSE) up -d ; \
$(DOCKER_COMPOSE) exec -T $(RELNAME) make $* ; \
res=$$? ; \
$(DOCKER_COMPOSE) down ; \
exit $$res ; \
}
check_w_container_%:
$(if $(filter $*,$(CALL_W_CONTAINER)),,\
$(error "Error: target '$*' cannot be called w_container_"))
$(if $(filter $*,$(CALL_W_CONTAINER)),,\
$(error "Error: target '$*' cannot be called w_container_"))