1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 03:32:20 +01:00

Merge branch 'dev' into bump-1.15.0b1

This commit is contained in:
Otto Winter
2020-07-26 22:12:53 +02:00
650 changed files with 29231 additions and 6310 deletions

View File

@@ -1,12 +1,21 @@
ARG BUILD_FROM=esphome/esphome-base-amd64:2.0.1
ARG BUILD_FROM=esphome/esphome-base-amd64:2.3.4
FROM ${BUILD_FROM}
# First install requirements to leverage caching when requirements don't change
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
# Then copy esphome and install
COPY . .
RUN pip3 install --no-cache-dir -e .
ENV USERNAME=""
ENV PASSWORD=""
# Settings for dashboard
ENV USERNAME="" PASSWORD=""
# The directory the user should mount their configuration files to
WORKDIR /config
# Set entrypoint to esphome so that the user doesn't have to type 'esphome'
# in every docker command twice
ENTRYPOINT ["esphome"]
# When no arguments given, start the dashboard in the workdir
CMD ["/config", "dashboard"]

13
docker/Dockerfile.dev Normal file
View File

@@ -0,0 +1,13 @@
FROM esphome/esphome-base-amd64:2.3.4
COPY . .
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-wheel \
net-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspaces
ENV SHELL /bin/bash

View File

@@ -1,11 +1,15 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}
# First install requirements to leverage caching when requirements don't change
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
# Copy root filesystem
COPY docker/rootfs/ /
COPY setup.py setup.cfg MANIFEST.in /opt/esphome/
COPY esphome /opt/esphome/esphome
# Then copy esphome and install
COPY . /opt/esphome/
RUN pip3 install --no-cache-dir -e /opt/esphome
# Build arguments

View File

@@ -1,18 +1,7 @@
FROM esphome/esphome-base-amd64:2.0.1
FROM esphome/esphome-lint-base:2.3.4
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
clang-format-7 \
clang-tidy-7 \
patch \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*
COPY requirements_test.txt /requirements_test.txt
RUN pip3 install --no-cache-dir wheel && pip3 install --no-cache-dir -r /requirements_test.txt
COPY requirements.txt requirements_test.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt -r /requirements_test.txt
RUN ln -s /usr/bin/pip3 /usr/bin/pip && ln -f -s /usr/bin/python3 /usr/bin/python

10
docker/rootfs/etc/cont-init.d/30-esphome.sh Normal file → Executable file
View File

@@ -8,7 +8,15 @@ declare esphome_version
if bashio::config.has_value 'esphome_version'; then
esphome_version=$(bashio::config 'esphome_version')
full_url="https://github.com/esphome/esphome/archive/${esphome_version}.zip"
if [[ $esphome_version == *":"* ]]; then
IFS=':' read -r -a array <<< "$esphome_version"
username=${array[0]}
ref=${array[1]}
else
username="esphome"
ref=$esphome_version
fi
full_url="https://github.com/${username}/esphome/archive/${ref}.zip"
bashio::log.info "Installing esphome version '${esphome_version}' (${full_url})..."
pip3 install -U --no-cache-dir "${full_url}" \
|| bashio::exit.nok "Failed installing esphome pinned version."

0
docker/rootfs/etc/cont-init.d/40-migrate.sh Normal file → Executable file
View File

0
docker/rootfs/etc/nginx/nginx.conf Executable file → Normal file
View File