-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (42 loc) · 1.5 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
include .mk_vars
objects_reddit = ui comment post
objects_monitoring = prometheus mongodb_exporter alertmanager grafana telegraf
objects_logging = fluentd
objects = $(objects_reddit) $(objects_monitoring) $(objects_logging)
objects_bugged = ui comment post
.PHONY : all
all : build push
.PHONY : build
build : $(objects_reddit) $(objects_monitoring) $(objects_logging)
$(objects_reddit) :
@echo "\e[93m\e[1m-- Building $@ image --\e[0m"
@cd src/$@* && sh docker_build.sh
$(objects_monitoring) :
@echo "\e[93m\e[1m-- Building $@ image --\e[0m"
@docker build -t $(USER_NAME)/$@ monitoring/$@
$(objects_logging) :
@echo "\e[93m\e[1m-- Building $@ image --\e[0m"
@docker build -t $(USER_NAME)/$@ logging/$@
.PHONY : push
push :
@echo "\e[93m\e[1m-- Pushing builded images --\e[0m"
@echo "\e[93m\e[1m> Enter docker password:\e[0m"
@docker login --username $(USER_NAME)
@for img in $(objects) ; do \
echo "\e[93m\e[1m>>> Pushing $${img}\e[0m" ; docker push $(USER_NAME)/$${img} ; \
done
.PHONY : bugged
bugged : build_bugged push_bugged
.PHONY : build_bugged
build_bugged : $(objects_bugged)
$(objects_bugged) :
@echo "\e[93m\e[1m-- Building $@:bugged image --\e[0m"
@cd src_bugged/$@* && sh docker_build.sh
.PHONY : push_bugged
push_bugged:
@echo "\e[93m\e[1m-- Pushing builded images --\e[0m"
@echo "\e[93m\e[1m> Enter docker password:\e[0m"
@docker login --username $(USER_NAME)
@for img in $(objects_bugged) ; do \
echo "\e[93m\e[1m>>> Pushing $${img}\e[0m" ; docker push $(USER_NAME)/$${img}:bugged ; \
done