Implement yaml file download

This commit is contained in:
Jakob Lechner 2025-03-01 18:33:54 +01:00
parent a21c54cfe8
commit af4e6ef214
3 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,2 @@
ESPHOME_HOST="192.168.42.1"
ESPHOME_SECRETS_FILE="esphome_${ESPHOME_HOST}_secrets.yaml"

View file

@ -0,0 +1,2 @@
/.esphome/
/secrets.yaml

View file

@ -0,0 +1,17 @@
import '../../../../../justfile'
set dotenv-load
download:
rsync \
-r \
--rsync-path='sudo rsync' \
--exclude '/build' \
--exclude '/.esphome' \
--exclude '.gitignore' \
--exclude 'secrets.yaml' \
192.168.42.1:/var/lib/esphome/ ./
download-secrets:
umask 0077 && ssh 192.168.42.1 sudo cat /run/secrets/esphome > "/dev/shm/${ESPHOME_SECRETS_FILE}"
ln -sf "/dev/shm/${ESPHOME_SECRETS_FILE}" "{{justfile_directory()}}/secrets.yaml"