1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Update esphomeyaml-edge

This commit is contained in:
Otto Winter 2018-11-24 17:33:52 +01:00
parent 2e5bbce104
commit 8587e7ad74
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
5 changed files with 77 additions and 70 deletions

View File

@ -62,21 +62,20 @@ test2:
stage: build stage: build
script: script:
- docker run --rm --privileged hassioaddons/qemu-user-static:latest - docker run --rm --privileged hassioaddons/qemu-user-static:latest
- BUILD_FROM=homeassistant/${ADDON_ARCH}-base-ubuntu:latest - BUILD_FROM=hassioaddons/ubuntu-base-${BUILD_ARCH}:2.2.0
- ADDON_VERSION="${CI_COMMIT_TAG#v}" - ADDON_VERSION="${CI_COMMIT_TAG#v}"
- ADDON_VERSION="${ADDON_VERSION:-${CI_COMMIT_SHA:0:7}}" - ADDON_VERSION="${ADDON_VERSION:-${CI_COMMIT_SHA:0:7}}"
- ESPHOMELIB_VERSION="${ESPHOMELIB_VERSION:-''}"
- echo "Build from ${BUILD_FROM}" - echo "Build from ${BUILD_FROM}"
- echo "Add-on version ${ADDON_VERSION}" - echo "Add-on version ${ADDON_VERSION}"
- echo "Esphomelib version ${ESPHOMELIB_VERSION}"
- echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:dev" - echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:dev"
- echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" - echo "Tag ${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}"
- | - |
docker build \ docker build \
--build-arg "BUILD_FROM=${BUILD_FROM}" \ --build-arg "BUILD_FROM=${BUILD_FROM}" \
--build-arg "ADDON_ARCH=${ADDON_ARCH}" \ --build-arg "BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg "ADDON_VERSION=${ADDON_VERSION}" \ --build-arg "BUILD_ARCH=${ADDON_ARCH}" \
--build-arg "ESPHOMELIB_VERSION=${ESPHOMELIB_VERSION}" \ --build-arg "BUILD_REF=${CI_COMMIT_SHA}" \
--build-arg "BUILD_VERSION=${ADDON_VERSION}" \
--tag "${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:dev" \ --tag "${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:dev" \
--tag "${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \ --tag "${CI_REGISTRY}/esphomeyaml-hassio-${ADDON_ARCH}:${CI_COMMIT_SHA}" \
--file "docker/Dockerfile.hassio" \ --file "docker/Dockerfile.hassio" \
@ -209,7 +208,6 @@ build:hassio-armhf-edge:
variables: variables:
ADDON_ARCH: armhf ADDON_ARCH: armhf
DO_PUSH: "false" DO_PUSH: "false"
ESPHOMELIB_VERSION: "${CI_COMMIT_TAG}"
build:hassio-armhf: build:hassio-armhf:
<<: *build-hassio-release <<: *build-hassio-release
@ -221,7 +219,6 @@ build:hassio-aarch64-edge:
variables: variables:
ADDON_ARCH: aarch64 ADDON_ARCH: aarch64
DO_PUSH: "false" DO_PUSH: "false"
ESPHOMELIB_VERSION: "${CI_COMMIT_TAG}"
build:hassio-aarch64: build:hassio-aarch64:
<<: *build-hassio-release <<: *build-hassio-release
@ -233,7 +230,6 @@ build:hassio-i386-edge:
variables: variables:
ADDON_ARCH: i386 ADDON_ARCH: i386
DO_PUSH: "false" DO_PUSH: "false"
ESPHOMELIB_VERSION: "${CI_COMMIT_TAG}"
build:hassio-i386: build:hassio-i386:
<<: *build-hassio-release <<: *build-hassio-release
@ -245,7 +241,6 @@ build:hassio-amd64-edge:
variables: variables:
ADDON_ARCH: amd64 ADDON_ARCH: amd64
DO_PUSH: "false" DO_PUSH: "false"
ESPHOMELIB_VERSION: "${CI_COMMIT_TAG}"
build:hassio-amd64: build:hassio-amd64:
<<: *build-hassio-release <<: *build-hassio-release

View File

@ -1,40 +1,78 @@
# Dockerfile for HassIO add-on ARG BUILD_FROM=hassioaddons/ubuntu-base:2.2.0
ARG BUILD_FROM=homeassistant/amd64-base-ubuntu:latest # hadolint ignore=DL3006
FROM ${BUILD_FROM} FROM ${BUILD_FROM}
RUN apt-get update && apt-get install -y --no-install-recommends \ # Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy root filesystem
COPY esphomeyaml-edge/rootfs /
COPY setup.py setup.cfg MANIFEST.in /opt/esphomeyaml/
COPY esphomeyaml /opt/esphomeyaml/esphomeyaml
RUN \
# Temporarily move nginx.conf (otherwise dpkg fails)
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bkp \
# Install add-on dependencies
&& apt-get update \
&& apt-get install -y --no-install-recommends \
# Python for esphomeyaml
python \ python \
python-pip \ python-pip \
python-setuptools \ python-setuptools \
# Python Pillow for display component
python-pil \ python-pil \
# Git for esphomelib downloads
git \ git \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* && \ # Ping for dashboard online/offline status
pip install --no-cache-dir --no-binary :all: platformio && \ iputils-ping \
platformio settings set enable_telemetry No && \ # NGINX proxy
platformio settings set check_libraries_interval 1000000 && \ nginx \
platformio settings set check_platformio_interval 1000000 && \ \
platformio settings set check_platforms_interval 1000000 && mv /etc/nginx/nginx.conf.bkp /etc/nginx/nginx.conf \
\
COPY docker/platformio.ini /pio/platformio.ini && pip2 install --no-cache-dir --no-binary :all: -e /opt/esphomeyaml \
RUN platformio run -d /pio; rm -rf /pio \
# tzlocal for automatic timezone detection
&& pip2 install --no-cache-dir --no-binary :all: tzlocal \
COPY . . \
RUN pip install --no-cache-dir --no-binary :all: -e . && \ # Change some platformio settings
pip install --no-cache-dir --no-binary :all: tzlocal && platformio settings set enable_telemetry No \
&& platformio settings set check_libraries_interval 1000000 \
CMD ["esphomeyaml", "/config/esphomeyaml", "dashboard"] && platformio settings set check_platformio_interval 1000000 \
&& platformio settings set check_platforms_interval 1000000 \
\
# Build an empty platformio project to force platformio to install all fw build dependencies
# The return-code will be non-zero since there's nothing to build.
&& (platformio run -d /opt/pio; echo "Done") \
\
# Cleanup
&& rm -fr \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/* \
/opt/pio/
# Build arugments # Build arugments
ARG ADDON_ARCH ARG BUILD_ARCH=amd64
ARG ADDON_VERSION ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
# Labels # Labels
LABEL \ LABEL \
io.hass.name="esphomeyaml" \ io.hass.name="esphomeyaml" \
io.hass.description="esphomeyaml HassIO add-on for intelligently managing all your ESP8266/ESP32 devices." \ io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
io.hass.arch="${ADDON_ARCH}" \ io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \ io.hass.type="addon" \
io.hass.version="${ADDON_VERSION}" \ io.hass.version=${BUILD_VERSION} \
io.hass.url="https://esphomelib.com/esphomeyaml/index.html" \ maintainer="Otto Winter <contact@otto-winter.com>" \
maintainer="Otto Winter <contact@otto-winter.com>" org.label-schema.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="esphomeyaml" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://esphomelib.com" \
org.label-schema.usage="https://github.com/OttoWinter/esphomeyaml/tree/dev/esphomeyaml/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/OttoWinter/esphomeyaml" \
org.label-schema.vendor="esphomelib"

View File

@ -1,12 +0,0 @@
; This file allows the docker build file to install the required platformio
; platforms
[env:espressif8266]
platform = espressif8266
board = nodemcuv2
framework = arduino
[env:espressif32]
platform = espressif32
board = nodemcu-32s
framework = arduino

View File

@ -8,12 +8,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy root filesystem # Copy root filesystem
COPY rootfs / COPY rootfs /
# Setup base system
ARG BUILD_ARCH=amd64
# Copy root filesystem
COPY rootfs /
RUN \ RUN \
# Temporarily move nginx.conf (otherwise dpkg fails) # Temporarily move nginx.conf (otherwise dpkg fails)
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bkp \ mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bkp \
@ -37,7 +31,7 @@ RUN \
\ \
&& pip2 install --no-cache-dir --no-binary :all: https://github.com/OttoWinter/esphomeyaml/archive/dev.zip \ && pip2 install --no-cache-dir --no-binary :all: https://github.com/OttoWinter/esphomeyaml/archive/dev.zip \
\ \
# tzlocal for automatic timezone detection, requests for HassIO API # tzlocal for automatic timezone detection
&& pip2 install --no-cache-dir --no-binary :all: tzlocal \ && pip2 install --no-cache-dir --no-binary :all: tzlocal \
\ \
# Change some platformio settings # Change some platformio settings
@ -58,13 +52,14 @@ RUN \
/opt/pio/ /opt/pio/
# Build arugments # Build arugments
ARG BUILD_ARCH=amd64
ARG BUILD_DATE ARG BUILD_DATE
ARG BUILD_REF ARG BUILD_REF
ARG BUILD_VERSION ARG BUILD_VERSION
# Labels # Labels
LABEL \ LABEL \
io.hass.name="esphomeyaml" \ io.hass.name="esphomeyaml-edge" \
io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \ io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
io.hass.arch="${BUILD_ARCH}" \ io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \ io.hass.type="addon" \
@ -72,10 +67,10 @@ LABEL \
maintainer="Otto Winter <contact@otto-winter.com>" \ maintainer="Otto Winter <contact@otto-winter.com>" \
org.label-schema.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \ org.label-schema.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
org.label-schema.build-date=${BUILD_DATE} \ org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="esphomeyaml" \ org.label-schema.name="esphomeyaml-edge" \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
org.label-schema.url="https://esphomelib.com" \ org.label-schema.url="https://esphomelib.com" \
org.label-schema.usage="https://github.com/OttoWinter/esphomeyaml/tree/dev/esphomeyaml-edge/README.md" \ org.label-schema.usage="https://github.com/OttoWinter/esphomeyaml/tree/dev/esphomeyaml-edge/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/OttoWinter/esphomeyaml" \ org.label-schema.vcs-url="https://github.com/OttoWinter/esphomeyaml" \
org.label-schema.vendor="esphomeyaml" org.label-schema.vendor="esphomelib"

View File

@ -1,6 +1,6 @@
# Esphomeyaml HassIO Add-On # Esphomeyaml HassIO Add-On
![esphomeyaml logo][logo.png] [![esphomeyaml logo](logo.png)](https://esphomelib.com/esphomeyaml/index.html)
## WARNING! THIS IS AN EDGE VERSION! ## WARNING! THIS IS AN EDGE VERSION!
@ -21,9 +21,7 @@ directly through HassIO **with no programming experience required**. All you nee
is write YAML configuration files; the rest (over-the-air updates, compiling) is all is write YAML configuration files; the rest (over-the-air updates, compiling) is all
handled by esphomeyaml. handled by esphomeyaml.
[Click here for the full documentation][docs] ![esphomeyaml dashboard screenshot](screenshot.png)
![esphomeyaml dashboard screenshot][screenshot.png]
## Installation ## Installation
@ -39,14 +37,7 @@ first:
**NOTE**: Installation on RPis running in 64-bit mode is currently not possible. Please use the 32-bit variant of HassOS instead. **NOTE**: Installation on RPis running in 64-bit mode is currently not possible. Please use the 32-bit variant of HassOS instead.
## Docker status You can view the esphomeyaml docs here: https://esphomelib.com/esphomeyaml/index.html
![Supports armhf Architecture][armhf-shield]
![Supports amd64 Architecture][amd64-shield]
![Supports i386 Architecture][i386-shield]
[![Docker Layers][layers-shield]][microbadger]
[![Docker Pulls][pulls-shield]][dockerhub]
## Configuration ## Configuration