home-assistant/Makefile

29 lines
676 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
2018-06-29 14:07:35 +00:00
test: pull
@$(HASS) --script check_config --files
2018-05-17 17:53:22 +00:00
2018-06-29 14:20:15 +00:00
.PHONY: run stop destroy pull deploy
run: pull
2018-05-17 17:53:22 +00:00
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:
2018-06-29 14:20:15 +00:00
-docker rm -f $(CONTAINER)
2018-05-17 17:53:22 +00:00
pull:
2018-06-30 00:43:49 +00:00
@docker pull $(IMAGE):$(HA_VERSION) >/dev/null
2018-06-29 14:20:15 +00:00
deploy: pull test destroy run