From 4c4ae2411f198377c3fc568c64b0b1acf5b64fc4 Mon Sep 17 00:00:00 2001 From: starcalc Date: Tue, 7 Jun 2022 22:17:19 +0200 Subject: [PATCH] Automatisierung des Upload-Hosts --- .drone.yml | 4 +++- platformio.ini | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8317fe5..a13de60 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,8 +10,10 @@ steps: - sed -i "s/WIFIPASS/$iotpwd/" data/homie/config.json - sed -i "s/HOSTNAME/$hostname/g" data/homie/config.json - sed -i "s/HOSTNAME/$hostname/g" data/homie/config.json - - sed -i "s/HOSTNAME/$hostname/g" platformio.ini + - lastknownip=$(mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/\$localip" -C 1) + - sed -i "s/HOSTNAME/$lastknownip/g" platformio.ini - cat data/homie/config.json + - cat platformio.ini - pip install -U platformio - platformio run --environment d1_mini environment: diff --git a/platformio.ini b/platformio.ini index ff1cea5..fd11692 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,6 +25,5 @@ lib_deps = https://github.com/adafruit/DHT-sensor-library https://github.com/adafruit/Adafruit_Sensor upload_protocol = espota -upload_port = 172.23.23.12 # volumeknob3 +upload_port = HOSTNAME # 172.23.23.12 # volumeknob3 upload_flags = --host_port=54321 -#upload_port = 10.90.25.206