-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (45 loc) · 2.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# make VERBOSE nonempty to see raw commands (or provide on command line)
ifndef VERBOSE
VERBOSE:=
endif
# use SHOW to inform user of commands
SHOW:=@echo
# use HIDE to run commands invisibly, unless VERBOSE defined
HIDE:=$(if $(VERBOSE),,@)
# Our applications recognize this as the top directory for the project, and look for files there
# at runtime, e.g. for configuration.
export ALACRIS_HOME:=$(shell pwd)
.PHONY: docker-build-all docker-build docker-list docker-up docker-start \
docker-stop docker-restart docker-status docker-clean docker-prune
# Docker part
DOCKER_COMPOSE = docker-compose
DOCKER_COMPOSE_FILE = docker/docker-compose.yml
docker-pull: ## Pull Alacris prerequisites images
$(SHOW) " Pulling Alacris Docker images"
$(HIDE) docker/scripts/pull_images.sh
## Build all containers in foreground (including build-prerequisites)
docker-build-all:
$(SHOW) " Building Alacris MKB Docker images"
$(HIDE) docker/scripts/build_all_images.sh
docker-build: ## Build all or c=<name> containers in foreground
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) build $(c)
docker-list: ## List available services
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) config --services
docker-up: ## Start all or c=<name> containers in foreground
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c)
docker-start: ## Start all or c=<name> containers in background
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d $(c)
docker-stop: ## Stop all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
docker-restart: ## Restart all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d $(c)
docker-status: ## Show status of containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) ps
docker-logs: ## Show logs for all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) logs --tail=100 -f $(c)
docker-clean: ## Clean all data
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) down -v
docker-prune: ## Delete dangling images
$(SHOW) Deleting dangling docker images
$(HIDE) docker system prune