Skip to content

Commit

Permalink
Docker: Added support for config volume
Browse files Browse the repository at this point in the history
  • Loading branch information
rotem925 committed Jan 6, 2021
1 parent 3e5dd5d commit 46131c1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ ENV USERNAME=
ENV PASSWORD=
ENV MQTT_HOST=
ENV MQTT_USER=
VOLUME [ "/opt/hisense" ]

CMD rm -Rf config_*.json && \
python -m aircon discovery $APP $USERNAME $PASSWORD && \
configs= && for i in $(find . -maxdepth 1 -type f -name "config_*.json" -exec basename {} \;); do configs="$configs --config $i --type $TYPE"; done && \
python -m aircon --log_level $LOG_LEVEL run --port $PORT --mqtt_host $MQTT_HOST --mqtt_user $MQTT_USER $configs
CMD \
if [ -z "$(cd /opt/hisense/ && find . -maxdepth 1 -type f -name "config_*.json")" ]; then \
rm -Rf config_*.json && python -m aircon discovery $APP $USERNAME $PASSWORD && mv config_*.json /opt/hisense/; \
fi; \
configs= ; for i in $(find /opt/hisense/ -maxdepth 1 -type f -name "config_*.json" -exec basename {} \;); do configs="$configs --config /opt/hisense/$i --type $TYPE"; done ; \
python -m aircon --log_level $LOG_LEVEL run --port $PORT --mqtt_host $MQTT_HOST --mqtt_user $MQTT_USER $configs

0 comments on commit 46131c1

Please sign in to comment.