forked from cennznet/cennznet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (36 loc) · 1.13 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
DIR := ${CURDIR}
#if make is typed with no further arguments, then show a list of available targets
default:
@awk -F\: '/^[a-z_]+:/ && !/default/ {printf "- %-20s %s\n", $$1, $$2}' Makefile
help:
@echo ""
@echo "make up: start all containers"
@echo "make stop [CONTAINER]: stop [CONTAINER]"
@echo "make logs [CONTAINER]: get logs"
@echo "make down: do a docker-compose down -v"
@echo "make start [CONTAINER]: start [CONTAINER]"
@echo ""
build:
@docker build $(filter-out $@,$(MAKECMDGOALS))
build-up:
docker-compose build && docker-compose up -d $(filter-out $@,$(MAKECMDGOALS))
up:
docker-compose up -d $(filter-out $@,$(MAKECMDGOALS))
pull:
docker-compose pull --parallel
down:
docker-compose down $(filter-out $@,$(MAKECMDGOALS))
start:
docker-compose start $(filter-out $@,$(MAKECMDGOALS))
stop:
docker-compose stop $(filter-out $@,$(MAKECMDGOALS))
restart:
docker-compose restart $(filter-out $@,$(MAKECMDGOALS))
logs:
docker-compose logs -f --tail=200 $(filter-out $@,$(MAKECMDGOALS))
prune:
@echo "pruning some old containers and images"
docker container prune --filter "until=336h"
docker image prune -a
%:
@: