From ef98ba85470dc9e6d959f6a432d634ec60bede9a Mon Sep 17 00:00:00 2001 From: starcalc Date: Tue, 7 Jun 2022 22:37:40 +0200 Subject: [PATCH] At this time, the only way to share data between steps is by writing to disk. Write the data to disk in one step, and read the data from disk in the next step. --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6b35990..b27a4bd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,8 @@ steps: - name: prereq image: cburki/mosquitto-clients commands: - - echo mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/\$localip" -C 1 - - lastknownip=$(mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/\$localip" -C 1) +# - echo mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/\$localip" -C 1 + - mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/\$localip" -C 1 | tr -d '\n' >/tmp/lastknownip environment: hostname: from_secret: hostname @@ -18,7 +18,7 @@ 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 - - echo $lastknownip + - lastknownip=$(cat /tmp/lastknownip) - sed -i "s/HOSTNAME/$lastknownip/g" platformio.ini - cat data/homie/config.json - cat platformio.ini