Skip to content
Snippets Groups Projects
Commit 83eb9399 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-367: Add 'make restart' and remove container on 'make stop'

parent e5c206d1
No related branches found
No related tags found
1 merge request!123L2SS-367: Cleanup containers on 'make clean', enhance 'make build'
...@@ -29,6 +29,8 @@ ifeq (start,$(firstword $(MAKECMDGOALS))) ...@@ -29,6 +29,8 @@ ifeq (start,$(firstword $(MAKECMDGOALS)))
SERVICE_TARGET = true SERVICE_TARGET = true
else ifeq (stop,$(firstword $(MAKECMDGOALS))) else ifeq (stop,$(firstword $(MAKECMDGOALS)))
SERVICE_TARGET = true SERVICE_TARGET = true
else ifeq (restart,$(firstword $(MAKECMDGOALS)))
SERVICE_TARGET = true
else ifeq (build,$(firstword $(MAKECMDGOALS))) else ifeq (build,$(firstword $(MAKECMDGOALS)))
SERVICE_TARGET = true SERVICE_TARGET = true
else ifeq (build-nocache,$(firstword $(MAKECMDGOALS))) else ifeq (build-nocache,$(firstword $(MAKECMDGOALS)))
...@@ -122,7 +124,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ ...@@ -122,7 +124,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
CONTAINER_EXECUTION_UID=$(shell id -u) CONTAINER_EXECUTION_UID=$(shell id -u)
.PHONY: up down minimal start stop status clean pull help .PHONY: up down minimal start stop restart build build-nocache status clean pull help
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
pull: ## pull the images from the Docker hub pull: ## pull the images from the Docker hub
...@@ -161,6 +163,11 @@ start: up ## start a service (usage: make start <servicename>) ...@@ -161,6 +163,11 @@ start: up ## start a service (usage: make start <servicename>)
stop: ## stop a service (usage: make stop <servicename>) stop: ## stop a service (usage: make stop <servicename>)
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) stop $(SERVICE) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) stop $(SERVICE)
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) rm -f $(SERVICE)
restart: ## restart a service (usage: make restart <servicename>)
make stop $(SERVICE) # cannot use dependencies, as that would allow start and stop to run in parallel..
make start $(SERVICE)
attach: ## attach a service to an existing Tango network attach: ## attach a service to an existing Tango network
$(DOCKER_COMPOSE_ARGS) docker-compose $(ATTACH_COMPOSE_FILE_ARGS) up -d $(SERVICE) $(DOCKER_COMPOSE_ARGS) docker-compose $(ATTACH_COMPOSE_FILE_ARGS) up -d $(SERVICE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment