esp-volumeknob/.drone.yml

47 lines
1.5 KiB
YAML
Raw Normal View History

2022-06-07 18:14:58 +00:00
---
2022-09-08 18:07:10 +00:00
2022-06-07 18:14:58 +00:00
kind: pipeline
type: docker
name: default
steps:
2022-09-08 18:07:10 +00:00
- name: fetch ips
2022-06-30 12:29:02 +00:00
image: cburki/mosquitto-clients
commands:
2022-09-08 18:07:10 +00:00
- rm -f lastknownhostips
- cat hosts
- for h in $(cat hosts); do mosquitto_sub -h raum.ctdo.de -t "homie/$h/\$localip" -C 1; done >lastknownips
- for h in $(cat hosts); do echo -n "$h," >>lastknownhostips; mosquitto_sub -h raum.ctdo.de -t "homie/$h/\$localip" -C 1 >>lastknownhostips; done
- cat lastknownhostips
- cat lastknownips
2022-06-30 12:29:02 +00:00
- name: build
image: suculent/platformio-docker-build
commands:
2022-09-08 18:07:10 +00:00
# Build images
2022-06-30 12:29:02 +00:00
- platformio run --environment d1_mini
2022-09-08 18:07:10 +00:00
- |
chmod u+x ./configurefs.sh
chmod u+x ./uploadfs.sh
./configurefs.sh
- name: upload image
2022-06-30 12:29:02 +00:00
image: curlimages/curl
commands:
# Upload image with espota-gateway
2022-09-08 18:07:10 +00:00
# All hosts receive the identical image
2022-06-30 12:29:02 +00:00
- |
2022-09-08 18:07:10 +00:00
cat lastknownips
for thisip in $(cat lastknownips)
do
echo "Current IP to upload is $thisip"
curl -m 180 --insecure --no-progress-meter --fail-with-body --request POST --url "https://espota.ctdo.de/" --header "Content-Type: multipart/form-data" --form ip="$thisip" --form firmware=@.pio/build/d1_mini/firmware.bin --no-buffer
done
- name: upload configs
image: curlimages/curl
commands:
- ls -lA .
- /bin/sh ./uploadfs.sh
environment:
IOTSSID:
from_secret: iotssid
iotpwd:
from_secret: iotpwd