-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
54 lines (44 loc) · 1.07 KB
/
GNUmakefile
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
TAG=tomgidden/rpi_bluemaestro_mqtt
HOSTNAME=campi
NAME=rpi_bluemaestro_mqtt
MQTT_TOPIC=/sensor/uk/CB29JW
MQTT_HOST=192.168.0.2
build: Dockerfile *.py requirements.txt
docker build . -t $(TAG)
run:
docker run \
--hostname $(HOSTNAME) \
--env MQTT_TOPIC=$(MQTT_TOPIC) \
--env MQTT_HOST=$(MQTT_HOST) \
--env MQTT_CLIENT_NAME=$(HOSTNAME) \
--net host \
--rm -it \
--name $(NAME) \
$(TAG)
kill:
docker rm -f $(NAME)
test:
docker run \
--hostname $(HOSTNAME) \
--env MQTT_TOPIC=$(MQTT_TOPIC) \
--env MQTT_HOST=$(MQTT_HOST) \
--env MQTT_CLIENT_NAME=$(HOSTNAME) \
--net host \
--rm -it \
--name $(NAME) \
$(TAG) \
bash
install-systemd:
sudo cp bluemaestro_mqtt_docker.service /etc/systemd/system
sudo systemctl daemon-reload
start-systemd:
sudo systemctl start bluemaestro_mqtt_docker
stop-systemd:
sudo systemctl stop bluemaestro_mqtt_docker
status-systemd:
sudo systemctl status bluemaestro_mqtt_docker --no-pager --full
sudo journalctl -u bluemaestro_mqtt_docker -f
logs:
docker logs $(NAME)
push:
docker push $(TAG):latest