mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 21:54:20 +01:00
Config check: Fix grep for Errors on stdout (#158)
* Update run.sh * remove tzdata while it is on base image * Update config.json
This commit is contained in:
@@ -4,7 +4,7 @@ FROM %%BASE_IMAGE%%
|
|||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
# Setup base
|
# Setup base
|
||||||
RUN apk add --no-cache tzdata jq python3 \
|
RUN apk add --no-cache jq python3 \
|
||||||
&& pip3 install --no-cache --upgrade pip
|
&& pip3 install --no-cache --upgrade pip
|
||||||
|
|
||||||
# Copy data
|
# Copy data
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Check HomeAssistant config",
|
"name": "Check HomeAssistant config",
|
||||||
"version": "0.6",
|
"version": "0.7",
|
||||||
"slug": "check_config",
|
"slug": "check_config",
|
||||||
"description": "Check HomeAssistant config with a new version",
|
"description": "Check HomeAssistant config with a new version",
|
||||||
"url": "https://home-assistant.io/addons/check_config/",
|
"url": "https://home-assistant.io/addons/check_config/",
|
||||||
|
|||||||
@@ -16,25 +16,25 @@ echo "[INFO] Start install HomeAssistant $VERSION"
|
|||||||
|
|
||||||
if ! PIP_OUTPUT="$(pip3 install "$CMD")"
|
if ! PIP_OUTPUT="$(pip3 install "$CMD")"
|
||||||
then
|
then
|
||||||
echo "[ERROR] Install HomeAssistant: $PIP_OUTPUT"
|
echo "[Error] Install HomeAssistant: $PIP_OUTPUT"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[INFO] Install done, check config now"
|
echo "[Info] Install done, check config now"
|
||||||
|
|
||||||
cp -r /config /tmp/config > /dev/null
|
cp -r /config /tmp/config > /dev/null
|
||||||
if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)"
|
if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)"
|
||||||
then
|
then
|
||||||
echo "[ERROR] Wrong config found!"
|
echo "[Error] Wrong config found!"
|
||||||
echo "$HASS_OUTPUT"
|
echo "$HASS_OUTPUT"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "$HASS_OUTPUT" | grep ERROR > /dev/null
|
if echo "$HASS_OUTPUT" | grep -i ERROR > /dev/null
|
||||||
then
|
then
|
||||||
echo "[ERROR] Wrong yaml found!"
|
echo "[Error] Found error inside log output!"
|
||||||
echo "$HASS_OUTPUT"
|
echo "$HASS_OUTPUT"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[INFO] Finish :)"
|
echo "[Info] Finish :)"
|
||||||
|
|||||||
Reference in New Issue
Block a user