-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
126 lines (89 loc) · 3.11 KB
/
Makefile
File metadata and controls
126 lines (89 loc) · 3.11 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# -----------------------------------------------------------------------------
# Install the service file.
# -----------------------------------------------------------------------------
install:
cp loki-server.service /lib/systemd/system/
systemctl daemon-reload
systemctl enable loki-server
uninstall:
systemctl disable loki-server
rm /lib/systemd/system/loki-server.service
systemctl daemon-reload
#------------------------------------------------------------------------------
# The container engine to use. Default to docker, but on Fedora must now use
# podman.
# ------------------------------------------------------------------------------
ENGINE = docker
# -----------------------------------------------------------------------------
# The container registry to use.
# -----------------------------------------------------------------------------
REGISTRY = registry.wojciechkozlowski.eu/wojtek/loki
# -----------------------------------------------------------------------------
# Default target.
# -----------------------------------------------------------------------------
default: all
# -----------------------------------------------------------------------------
# html
# -----------------------------------------------------------------------------
HTML = $(REGISTRY)/html
html-clean:
$(ENGINE) rmi $(HTML) || /bin/true
html-build:
$(ENGINE) build -f html/Dockerfile -t $(HTML) ./html
html-push:
$(ENGINE) push $(HTML)
html-pull:
$(ENGINE) pull $(HTML)
html: html-clean html-build html-push
# -----------------------------------------------------------------------------
# proxy
# -----------------------------------------------------------------------------
PROXY = $(REGISTRY)/proxy
proxy-clean:
$(ENGINE) rmi $(PROXY) || /bin/true
proxy-build:
$(ENGINE) build -f proxy/Dockerfile -t $(PROXY) ./proxy
proxy-push:
$(ENGINE) push $(PROXY)
proxy-pull:
$(ENGINE) pull $(PROXY)
proxy: proxy-clean proxy-build proxy-push
# -----------------------------------------------------------------------------
# nextcloud
# -----------------------------------------------------------------------------
NEXTCLOUD = $(REGISTRY)/nextcloud
nextcloud-clean:
$(ENGINE) rmi $(NEXTCLOUD) || /bin/true
nextcloud-build:
$(ENGINE) build -f nextcloud/Dockerfile -t $(NEXTCLOUD) ./nextcloud
nextcloud-push:
$(ENGINE) push $(NEXTCLOUD)
nextcloud-pull:
$(ENGINE) pull $(NEXTCLOUD)
nextcloud: nextcloud-clean nextcloud-build nextcloud-push
# -----------------------------------------------------------------------------
# Collect targets.
# -----------------------------------------------------------------------------
clean-all:
$(ENGINE) container prune -f
$(ENGINE) image prune -a -f
clean-builds: \
html-clean \
proxy-clean \
nextcloud-clean
build-all: \
html-build \
proxy-build \
nextcloud-build
push-all: \
html-push \
proxy-push \
nextcloud-push
pull-all: \
html-pull \
proxy-pull \
nextcloud-pull
# -----------------------------------------------------------------------------
# Clean - build - push
# -----------------------------------------------------------------------------
all: clean-all build-all push-all