-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
38 lines (28 loc) · 899 Bytes
/
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
PROJECT ?= elastic-rails
DOCKER_COMPOSE_FILE ?= docker-compose.services.yml
DOCKER_COMPOSE_ARGS ?= -p $(PROJECT) -f $(DOCKER_COMPOSE_FILE)
SHELL := /bin/bash
run: help
BOLD ?= $(shell tput bold)
NORMAL ?= $(shell tput sgr0)
help:
@echo Run elasticsearch for development:
@echo " ${BOLD}make services-up${NORMAL}"
@echo ""
@echo "Reset the environment:"
@echo " ${BOLD}make services-destroy${NORMAL}"
@echo ""
services: services-up
services-ps:
docker-compose $(DOCKER_COMPOSE_ARGS) ps
services-up:
docker-compose $(DOCKER_COMPOSE_ARGS) up -d
services-stop:
docker-compose $(DOCKER_COMPOSE_ARGS) stop
services-destroy:
docker-compose $(DOCKER_COMPOSE_ARGS) down --volumes
services-logs:
docker-compose $(DOCKER_COMPOSE_ARGS) logs -f
services-port:
@set -o pipefail; \
docker-compose $(DOCKER_COMPOSE_ARGS) port ${SERVICE} ${PORT} 2> /dev/null | cut -d':' -f2 || echo ${PORT}