esp-volumeknob/.drone.yml

39 lines
1.1 KiB
YAML
Raw Normal View History

2022-06-07 18:14:58 +00:00
---
kind: pipeline
type: docker
name: default
steps:
2022-06-07 20:21:22 +00:00
- name: prereq
image: cburki/mosquitto-clients
commands:
2022-06-07 20:22:31 +00:00
- lastknownip=$(mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/$$localip" -C 1)
2022-06-07 20:23:30 +00:00
environment:
hostname:
from_secret: hostname
2022-06-07 18:14:58 +00:00
- name: build
2022-06-07 18:16:28 +00:00
image: python:3.10
2022-06-07 18:14:58 +00:00
commands:
2022-06-07 19:44:26 +00:00
- sed -i "s/WIFISSID/$IOTSSID/" data/homie/config.json
2022-06-07 19:46:14 +00:00
- 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
2022-06-07 20:21:22 +00:00
- echo $lastknownip
2022-06-07 20:17:19 +00:00
- sed -i "s/HOSTNAME/$lastknownip/g" platformio.ini
2022-06-07 19:46:14 +00:00
- cat data/homie/config.json
2022-06-07 20:17:19 +00:00
- cat platformio.ini
2022-06-07 19:46:14 +00:00
- pip install -U platformio
2022-06-07 19:52:07 +00:00
- platformio run --environment d1_mini
2022-06-07 20:00:17 +00:00
environment:
2022-06-07 19:29:06 +00:00
hostname:
2022-06-07 18:16:28 +00:00
from_secret: hostname
2022-06-07 19:41:28 +00:00
IOTSSID:
2022-06-07 19:10:14 +00:00
from_secret: iotssid
iotpwd:
from_secret: iotpwd
2022-06-07 19:52:07 +00:00
- name: release
2022-06-07 19:53:41 +00:00
image: python:3.10
2022-06-07 19:52:07 +00:00
commands:
2022-06-07 19:53:41 +00:00
- pip install -U platformio
2022-06-07 19:52:07 +00:00
- platformio run --target upload --environment d1_mini
- platformio run --target uploadfs --environment d1_mini