Compare commits

...

1 Commits

Author SHA1 Message Date
J. Nick Koston
36668539ec [docker] Make ESP-IDF venvs cleanable with "Clean All" 2025-12-31 10:04:28 -10:00
2 changed files with 18 additions and 4 deletions

View File

@@ -15,12 +15,19 @@ if [[ ! -d "${pio_cache_base}" ]]; then
mkdir -p "${pio_cache_base}"
fi
# we can't set core_dir, because the settings file is stored in `core_dir/appstate.json`
# setting `core_dir` would therefore prevent pio from accessing
# We can't set PLATFORMIO_CORE_DIR because the settings file is stored in
# `core_dir/appstate.json` and setting it would prevent pio from reading
# cached settings. Instead we override individual subdirectories.
export PLATFORMIO_PLATFORMS_DIR="${pio_cache_base}/platforms"
export PLATFORMIO_PACKAGES_DIR="${pio_cache_base}/packages"
export PLATFORMIO_CACHE_DIR="${pio_cache_base}/cache"
# Symlink penv to persistent storage so ESP-IDF venvs can be cleaned with
# "Clean All". There's no env var for penv location.
mkdir -p "${pio_cache_base}/penv"
mkdir -p /root/.platformio
ln -sfn "${pio_cache_base}/penv" /root/.platformio/penv
# If /build is mounted, use that as the build path
# otherwise use path in /config (so that builds aren't lost on container restart)
if [[ -d /build ]]; then

View File

@@ -9,12 +9,19 @@ readonly pio_cache_base=/data/cache/platformio
export ESPHOME_IS_HA_ADDON=true
export PLATFORMIO_GLOBALLIB_DIR=/piolibs
# we can't set core_dir, because the settings file is stored in `core_dir/appstate.json`
# setting `core_dir` would therefore prevent pio from accessing
# We can't set PLATFORMIO_CORE_DIR because the settings file is stored in
# `core_dir/appstate.json` and setting it would prevent pio from reading
# cached settings. Instead we override individual subdirectories.
export PLATFORMIO_PLATFORMS_DIR="${pio_cache_base}/platforms"
export PLATFORMIO_PACKAGES_DIR="${pio_cache_base}/packages"
export PLATFORMIO_CACHE_DIR="${pio_cache_base}/cache"
# Symlink penv to persistent storage so ESP-IDF venvs can be cleaned with
# "Clean All". There's no env var for penv location.
mkdir -p "${pio_cache_base}/penv"
mkdir -p /root/.platformio
ln -sfn "${pio_cache_base}/penv" /root/.platformio/penv
if bashio::config.true 'leave_front_door_open'; then
export DISABLE_HA_AUTHENTICATION=true
fi