-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
91 lines (68 loc) · 1.82 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
80
81
82
83
84
85
86
87
88
89
90
91
SERVICES:=waveapp
SERVICE:=waveapp
CONSOLE:=bash
CMD:=
ARGS:=
TIMEOUT:=90
# APP ON CI
.PHONY: app-wait
app-wait:
timeout ${TIMEOUT} ./scripts/ci/status_code_check.sh
# https://github.com/containers/podman-compose/issues/491#issuecomment-1289944841
CONTAINER_APP=docker-compose \
--env-file=.env \
--project-name egh-waveapp \
--file containers/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} ./scripts/ci/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/
.PHONY:create-dotenv
create-dotenv:
touch .env
echo -n "HOST_UID=`id -u`\nHOST_GID=`id -g`" > .env