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
|
||||
|
||||
# Setup base
|
||||
RUN apk add --no-cache tzdata jq python3 \
|
||||
RUN apk add --no-cache jq python3 \
|
||||
&& pip3 install --no-cache --upgrade pip
|
||||
|
||||
# Copy data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Check HomeAssistant config",
|
||||
"version": "0.6",
|
||||
"version": "0.7",
|
||||
"slug": "check_config",
|
||||
"description": "Check HomeAssistant config with a new version",
|
||||
"url": "https://home-assistant.io/addons/check_config/",
|
||||
|
||||
@@ -16,25 +16,25 @@ echo "[INFO] Start install HomeAssistant $VERSION"
|
||||
|
||||
if ! PIP_OUTPUT="$(pip3 install "$CMD")"
|
||||
then
|
||||
echo "[ERROR] Install HomeAssistant: $PIP_OUTPUT"
|
||||
echo "[Error] Install HomeAssistant: $PIP_OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[INFO] Install done, check config now"
|
||||
echo "[Info] Install done, check config now"
|
||||
|
||||
cp -r /config /tmp/config > /dev/null
|
||||
if ! HASS_OUTPUT="$(hass -c /tmp/config --script check_config)"
|
||||
then
|
||||
echo "[ERROR] Wrong config found!"
|
||||
echo "[Error] Wrong config found!"
|
||||
echo "$HASS_OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if echo "$HASS_OUTPUT" | grep ERROR > /dev/null
|
||||
if echo "$HASS_OUTPUT" | grep -i ERROR > /dev/null
|
||||
then
|
||||
echo "[ERROR] Wrong yaml found!"
|
||||
echo "[Error] Found error inside log output!"
|
||||
echo "$HASS_OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[INFO] Finish :)"
|
||||
echo "[Info] Finish :)"
|
||||
|
||||
Reference in New Issue
Block a user