-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
146 lines (99 loc) · 3.47 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
-include config.mk
ENV ?=
.PHONY: dev re_main re_broadcast re_icecast main broadcast icecast admin piwik piwikmysql dashing ftpd
.PHONY: up
up:
$(ENV) docker-compose up -d --no-recreate
.PHONY: repair
repair:
(echo 'input.harbor_0.stop'; echo 'quit'; sleep 1) | make -s telnet_broadcast || true
(echo 'input.harbor_1.stop'; echo 'quit'; sleep 1) | make -s telnet_broadcast || true
.PHONY: auto_repair
auto_repair:
@make curl_icecast | grep -q "Maintenance en cours" && (date; make repair) || true
.PHONY: auto_repair_loop
auto_repair_loop:
while true; do printf "."; make -s auto_repair; sleep 10; done
.PHONY: down ps
down ps:
$(ENV) docker-compose $@
.PHONY: logs
logs:
$(ENV) docker-compose logs --tail=1000 -f
dev: chmod broadcast
$(ENV) docker-compose up --no-deps main
main_skip:
printf "rscc.main.remaining\nrscc.main.skip\nquit\n" | make telnet_main
telnet_main:
telnet `docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' scc-radio_main_1` 5000
telnet_broadcast:
telnet `docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' scc-radio_broadcast_1` 5000
curl_icecast:
curl -s http://`docker inspect -f '{{(index .NetworkSettings.Networks "scc-radio_default").IPAddress}}' scc-radio_icecast_1`:8000
re_main: broadcast
-$(ENV) docker-compose kill main
-$(ENV) docker-compose rm --force main
-$(ENV) docker-compose up -d --no-deps main
$(MAKE) admin
-$(ENV) docker-compose logs main
re_testing:
-$(ENV) docker-compose kill testing
-$(ENV) docker-compose rm --force testing
-$(ENV) docker-compose up -d --no-deps testing
$(MAKE) admin
-$(ENV) docker-compose logs testing
re_broadcast: icecast
-$(ENV) docker-compose kill broadcast
-$(ENV) docker-compose rm --force broadcast
-$(ENV) docker-compose up -d --no-deps broadcast
-$(ENV) docker-compose logs broadcast
re_icecast:
-$(ENV) docker-compose kill icecast
-$(ENV) docker-compose rm --force icecast
-$(ENV) docker-compose up -d --no-deps icecast
-$(ENV) docker-compose logs icecast
main: broadcast
$(ENV) docker-compose up -d --no-deps --no-recreate $@
broadcast: icecast
$(ENV) docker-compose up -d --no-deps --no-recreate $@
icecast:
$(ENV) docker-compose up -d --no-deps --no-recreate $@
piwik: piwikmysql
-$(ENV) docker-compose kill $@
-$(ENV) docker-compose rm --force $@
$(ENV) docker-compose up -d --no-deps $@
$(ENV) docker-compose logs $@
admin:
-$(ENV) docker-compose kill $@
-$(ENV) docker-compose rm --force $@
$(ENV) docker-compose up -d --no-deps $@
#$(ENV) docker-compose logs $@
piwikmysql:
$(ENV) docker-compose up -d --no-recreate $@
piwikmysql-client: piwikmysql
docker run -it --rm --link radioscc_piwikmysql_1:mysql -e MYSQL_ROOT_PASSWORD=$(MYSQL_PASSWORD) mysql /bin/bash -c 'mysql -h$$MYSQL_PORT_3306_TCP_ADDR -p$$MYSQL_ENV_MYSQL_ROOT_PASSWORD piwik'
piwikcron:
-$(ENV) docker-compose kill $@
$(ENV) docker-compose up -d $@
kill:
docker-compose kill
clean: kill
docker-compose --force rm
chmod:
chmod -R 777 data playlists
sync-1and1:
du -hs backup-1and1
find backup-1and1 -type f | wc -l
lftp -c "set ftp:list-options -a; open '$(1AND1_FTP)';lcd backup-1and1; mirror"
du -hs backup-1and1
find backup-1and1 -type f | wc -l
dashing:
-$(ENV) docker-compose kill $@
-$(ENV) docker-compose rm --force $@
$(ENV) docker-compose up -d --no-deps $@
$(ENV) docker-compose logs $@
ftpd:
-$(ENV) docker-compose kill $@
-$(ENV) docker-compose rm --force $@
$(ENV) docker-compose up -d --no-deps $@
$(ENV) docker-compose logs $@