-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
79 lines (61 loc) · 1.63 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
SERVICES:=
SERVICE:=
CONSOLE:=bash
CMD:=
ARGS:=
TIMEOUT:=90
PROJECT:=
# https://github.com/containers/podman-compose/issues/491#issuecomment-1289944841
CONTAINER_APP=docker-compose \
--env-file=.env \
--project-name pocdocker \
--file containers/${PROJECT}/compose.yaml
# CONTAINER_APP
.ONESHELL:
.PHONY:containers-pull
containers-pull:
set -e
$(CONTAINER_APP) pull ${SERVICES}
.ONESHELL:
.PHONY:containers-build
containers-build: containers-pull
set -e
$(CONTAINER_APP) build ${SERVICES}
.PHONY:containers-start
containers-start:
set -ex
$(CONTAINER_APP) up --remove-orphans -d ${SERVICES}
.PHONY:containers-stop
containers-stop:
set -ex
$(CONTAINER_APP) stop ${SERVICES}
.PHONY:containers-restart
containers-restart: containers-stop containers-start
.PHONY:containers-logs
containers-logs:
$(CONTAINER_APP) logs ${ARGS} ${SERVICES}
.PHONY:containers-logs-follow
containers-logs-follow:
$(CONTAINER_APP) logs --follow ${ARGS} ${SERVICES}
.PHONY: containers-wait
containers-wait:
timeout ${TIMEOUT} ./containers/healthcheck.sh ${SERVICE}
.PHONY:containers-exec
containers-exec:
set -e
$(CONTAINER_APP) exec ${ARGS} ${SERVICE} ${CMD}
.PHONY:containers-console
containers-console:
set -e
$(MAKE) containers-exec ARGS="${ARGS}" SERVICE=${SERVICE} CMD="${CONSOLE}"
.PHONY:containers-run-console
containers-run-console:
set -e
$(CONTAINER_APP) run --rm ${ARGS} ${SERVICE} ${CONSOLE}
.PHONY:containers-down
containers-down:
$(CONTAINER_APP) down --volumes --remove-orphans
# https://github.com/containers/podman/issues/5114#issuecomment-779406347
.PHONY:containers-reset-storage
containers-reset-storage:
rm -rf ~/.local/share/containers/