home-assistant/Makefile

29 lines
611 B
Makefile
Raw Normal View History

IMAGE = homeassistant/home-assistant
2018-05-17 17:53:22 +00:00
CONTAINER = home-assistant
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 \
$(IMAGE)
stop:
docker stop $(CONTAINER)
destroy:
docker rm -f $(CONTAINER)
pull:
docker pull $(IMAGE)
deploy: test destroy run
upgrade: pull deploy