Update eufy-ha-mqtt-bridge to prebuild images

This commit is contained in:
Max Winterstein
2021-02-15 07:58:42 +01:00
parent 12f6ba34fd
commit 257b45b777
8 changed files with 71 additions and 52 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## [1.10.0] - 2021-02-14
- Use Pre-build containers (no more unused docker images, yay).
**🚨 !!Important Update Notice!! 🚨**
The Update progress might fail when the installed version is <1.10.0.
Copy your *Configuration* to your clipboard and Uninstall/Install manually.
## [1.9.0] - 2021-02-05
- Update `eufy-ha-mqtt-bridge` to `0.2.10` [Changelog](https://github.com/matijse/eufy-ha-mqtt-bridge/releases)
- Add new configration option `mqtt.keepalive`

View File

@@ -1,3 +1,18 @@
# sneaky trick to get around the requirement of {arch}-variabe based docker repositories
ARG BUILD_FROM
FROM $BUILD_FROM
FROM maxwinterstein/homeassistant-addon-eufy-ha-mqtt-bridge:1.9.0
ARG VERSION=0.2.10
RUN apk add --no-cache nodejs npm make g++
# add source and unpack
ADD "https://github.com/matijse/eufy-ha-mqtt-bridge/archive/${VERSION}.tar.gz" /src.tar.gz
RUN mkdir /app && tar xvfz /src.tar.gz -C /app --strip-components=1
# install all (and json2yaml for cofiguration parsing)
WORKDIR /app
RUN npm install && npm install -g json2yaml && echo ${VERSION} > /version
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]

View File

@@ -1,19 +0,0 @@
FROM hassioaddons/debian-base
ENV LANG C.UTF-8
ARG VERSION=0.2.10
# install node and build tools (needed by node-pre-gy)
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt install -y nodejs g++ make python
# add source and unpack
ADD "https://github.com/matijse/eufy-ha-mqtt-bridge/archive/${VERSION}.tar.gz" /src.tar.gz
RUN mkdir /app && tar xvfz /src.tar.gz -C /app --strip-components=1
# install all (and json2yaml for cofiguration parsing)
WORKDIR /app
RUN npm install && npm install -g json2yaml && echo ${VERSION} > /version
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]

View File

@@ -1,3 +1,9 @@
---
# 🚨 !!Important Update Notice!! 🚨
This addon recently switched to pre-build images. The Update progress might fail when the installed version is <0.6.0.
Copy your *Configuration* to your clipboard and Uninstall/Install manually.
---
# Home Assistant Add-on: Eufy Home Assistant MQTT Bridge
## Based on https://github.com/matijse/eufy-ha-mqtt-bridge/

View File

@@ -0,0 +1,9 @@
{
"build_from": {
"aarch64": "ghcr.io/hassio-addons/base-python/aarch64:6.0.0",
"amd64": "ghcr.io/hassio-addons/base-python/amd64:6.0.0",
"armhf": "ghcr.io/hassio-addons/base-python/armhf:6.0.0",
"armv7": "ghcr.io/hassio-addons/base-python/armv7:6.0.0",
"i386": "ghcr.io/hassio-addons/base-python/i386:6.0.0"
}
}

View File

@@ -1,13 +1,15 @@
{
"name": "Eufy Home Assistant MQTT Bridge",
"version": "1.9.0",
"version": "1.10.0",
"slug": "eufy-ha-mqtt-bridge",
"image": "maxwinterstein/homeassistant-addon-eufy-ha-mqtt-bridge-{arch}",
"description": "Publish events as MQTT messages",
"arch": [
"armhf",
"armv7",
"aarch64",
"amd64"
"amd64",
"i386"
],
"startup": "application",
"boot": "auto",

View File

@@ -5,7 +5,7 @@ echo "Newest version of eufy-ha-mqtt-bridge: $MQTT_BRIDGE_VERSION"
echo "MQTT_BRIDGE_VERSION=$MQTT_BRIDGE_VERSION" >> $GITHUB_ENV
echo "Check if $MQTT_BRIDGE_VERSION is already used..."
grep "ARG VERSION=${MQTT_BRIDGE_VERSION}" Dockerfile-real && { echo "Version is the same, nothing to do"; exit 0; } || echo "Version is different, will continue..."
grep "ARG VERSION=${MQTT_BRIDGE_VERSION}" Dockerfile && { echo "Version is the same, nothing to do"; exit 0; } || echo "Version is different, will continue..."
echo "CONTINUE=true" >> $GITHUB_ENV;
echo "Reading current addon version"
@@ -16,8 +16,7 @@ echo "Update config..."
sed -i.bak "s|\ \ \"version\": \".*$|\ \ \"version\": \"$ADDON_NEXT_VERSION\",|" config.json
echo "Update Dockerfile..."
sed -i.bak "s|eufy-ha-mqtt-bridge:.*$|eufy-ha-mqtt-bridge:${ADDON_NEXT_VERSION}|" Dockerfile
sed -i.bak "s|VERSION=.*$|VERSION=${MQTT_BRIDGE_VERSION}|" Dockerfile-real
sed -i.bak "s|VERSION=.*$|VERSION=${MQTT_BRIDGE_VERSION}|" Dockerfile
echo "Update CHANGELOG..."
sed -i.bak "2 a ## [${ADDON_NEXT_VERSION}] - $(date +%Y-%m-%d)" CHANGELOG.md