kind: pipeline type: docker name: default steps: - name: configure image: alpine commands: - sed -i "s/HOSTNAME/$HOSTNAME/" data/homie/config.json - sed -i "s/WIFI_SSID/$WIFI_SSID/" data/homie/config.json - sed -i "s/WIFI_PASS/$WIFI_PASS/" data/homie/config.json - cat data/homie/config.json environment: HOSTNAME: esp-waehlscheibe WIFI_SSID: from_secret: wifi_ssid WIFI_PASS: from_secret: wifi_pass - name: build image: infinitecoding/platformio-for-ci:latest commands: - platformio --version # Build image - platformio run --environment d1_mini # Build file system image - platformio run --target buildfs --environment d1_mini - name: find device ip image: cburki/mosquitto-clients commands: - mosquitto_sub -h mqtt.ctdo.de -t "homie/$HOSTNAME/\$localip" -C 1 | tr -d '\n' >device_ip - cat device_ip - : # noop, so that drone shows the output of cat environment: HOSTNAME: esp-waehlscheibe when: branch: - master - name: upload image: curlimages/curl commands: - echo "$PWD" - ls /drone/src - ls /drone/src/drone - ls -al ./drone # Upload firmware - sh ./drone/espota-deploy.sh "$device_ip" ".pio/build/d1_mini/firmware.bin" # Upload file system - sh ./drone/espota-deploy.sh "$device_ip" ".pio/build/d1_mini/spiffs.bin" when: branch: - master