45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
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' | tee device_ip
|
|
environment:
|
|
HOSTNAME: esp-waehlscheibe
|
|
when:
|
|
branch:
|
|
- master
|
|
- name: upload
|
|
image: curlimages/curl
|
|
commands:
|
|
# Upload firmware
|
|
- ./drone/espota-deploy.sh "$device_ip" ".pio/build/d1_mini/firmware.bin"
|
|
# Upload file system
|
|
- ./drone/espota-deploy.sh "$device_ip" ".pio/build/d1_mini/spiffs.bin"
|
|
when:
|
|
branch:
|
|
- master
|