IMAGE = homeassistant/home-assistant CONTAINER = home-assistant 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: pull @$(HASS) --script check_config --files .PHONY: run stop destroy pull deploy run: pull docker run -d \ --name $(CONTAINER) \ $(addprefix -v ,$(VOLUMES)) \ --net=host \ $(IMAGE):$(HA_VERSION) stop: docker stop $(CONTAINER) destroy: -docker rm -f $(CONTAINER) pull: @docker pull $(IMAGE):$(HA_VERSION) >/dev/null deploy: pull test destroy run