hass-core/scripts/dev_docker

33 lines
674 B
Text
Raw Normal View History

2015-02-17 00:56:35 -08:00
# Optional: pass in a timezone as first argument
# If not given will attempt to mount /etc/localtime
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
docker build -t home-assistant-dev .
2015-02-21 16:59:17 -08:00
# TODO set device via command line, remove /bin/bash
2015-02-17 00:56:35 -08:00
if [ $# -gt 0 ]
then
docker run \
--net=host \
--device=/dev/ttyUSB0:/zwaveusbstick:rwm \
2015-02-17 00:56:35 -08:00
-e "TZ=$1" \
-v `pwd`:/usr/src/app \
-v `pwd`/config:/config \
2015-02-21 16:59:17 -08:00
-t -i home-assistant-dev \
/bin/bash
2015-02-17 00:56:35 -08:00
else
docker run \
--net=host \
-v /etc/localtime:/etc/localtime:ro \
-v `pwd`:/usr/src/app \
-v `pwd`/config:/config \
-t -i home-assistant-dev
fi