36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
steps:
|
|
- name: prereq
|
|
image: cburki/mosquitto-clients
|
|
commands:
|
|
- lastknownip=$(mosquitto_sub -h mqtt.ctdo.de -t "homie/$hostname/$$localip" -C 1)
|
|
- name: build
|
|
image: python:3.10
|
|
commands:
|
|
- sed -i "s/WIFISSID/$IOTSSID/" data/homie/config.json
|
|
- 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
|
|
- 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:
|
|
hostname:
|
|
from_secret: hostname
|
|
IOTSSID:
|
|
from_secret: iotssid
|
|
iotpwd:
|
|
from_secret: iotpwd
|
|
- name: release
|
|
image: python:3.10
|
|
commands:
|
|
- pip install -U platformio
|
|
- platformio run --target upload --environment d1_mini
|
|
- platformio run --target uploadfs --environment d1_mini
|