-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
34 lines (31 loc) · 1.21 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
ARG ESPHOME_BUILD_VERSION=latest
ARG ESPHOME_CFG
FROM ghcr.io/bbusse/esphome-build:${ESPHOME_BUILD_VERSION}
LABEL maintainer="Björn Busse <bj.rn@baerlin.eu>"
LABEL org.opencontainers.image.source https://github.com/bbusse/compost-sensor
ARG ESPHOME_CFG
ENV ARCH="x86_64" \
ESPHOME_CFG=${ESPHOME_CFG} \
USER="build" \
HA_API_PASSWORD="secret" \
HA_OTA_PASSWORD="secret" \
WIFI_SSID="unknown" \
WIFI_PASSPHRASE="secretpassphrase" \
WIFI_FALLBACK_SSID="compost-0" \
WIFI_FALLBACK_PASSPHRASE="secretipassphrase"
USER $USER
RUN cd && ls -al && \
. esphome/bin/activate && \
curl -O https://raw.githubusercontent.com/bbusse/esphome-cfg/main/${ESPHOME_CFG} && \
echo "ha_api_password: $HA_API_PASSWORD" >> secrets.yaml && \
echo "ha_ota_password: $HA_OTA_PASSWORD" >> secrets.yaml && \
echo "wifi_ssid: $WIFI_SSID" >> secrets.yaml && \
echo "wifi_passphrase: $WIFI_PASSPHRASE" >> secrets.yaml && \
echo "wifi_fallback_ssid: $WIFI_FALLBACK_SSID" >> secrets.yaml && \
echo "wifi_fallback_passphrase: $WIFI_FALLBACK_PASSPHRASE" >> secrets.yaml && \
pio --version &&\
pio -h &&\
pio boards && \
pio upgrade &&\
esphome version &&\
esphome compile ${ESPHOME_CFG}