home-assistant/Makefile

30 lines
672 B
Makefile
Raw Normal View History

IMAGE = homeassistant/home-assistant
2018-05-17 17:53:22 +00:00
CONTAINER = home-assistant
2018-06-08 21:34:59 +00:00
HA_VERSION = $(shell cat .HA_VERSION)
HASS_BIN = python -m homeassistant
VOLUMES = $(PWD):/config /etc/localtime:/etc/localtime:ro
HASS = docker run -it --rm \
$(addprefix -v ,$(VOLUMES)) \
$(IMAGE) $(HASS_BIN) \
--config /config
.PHONY: test
test:
@$(HASS) --script check_config --files
2018-05-17 17:53:22 +00:00
.PHONY: run stop destroy pull deploy upgrade
run:
docker run -d \
--name $(CONTAINER) \
$(addprefix -v ,$(VOLUMES)) \
--net=host \
2018-06-13 00:26:29 +00:00
$(IMAGE):$(HA_VERSION)
2018-05-17 17:53:22 +00:00
stop:
docker stop $(CONTAINER)
destroy:
docker rm -f $(CONTAINER)
pull:
2018-06-08 21:34:59 +00:00
docker pull $(IMAGE):$(HA_VERSION)
2018-06-08 21:35:13 +00:00
deploy: destroy run
2018-05-17 17:53:22 +00:00
upgrade: pull deploy