configure drone build
continuous-integration/drone Build is failing
Details
continuous-integration/drone Build is failing
Details
This commit is contained in:
parent
ca59af3c62
commit
94dbcf7895
|
@ -0,0 +1,43 @@
|
|||
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
|
||||
environment:
|
||||
HOSTNAME: esp-waehlscheibe
|
||||
WIFI_SSID:
|
||||
from_secret: wifi_ssid
|
||||
WIFI_PASS:
|
||||
from_secret: wifi_pass
|
||||
- name: build
|
||||
image: suculent/platformio-docker-build
|
||||
commands:
|
||||
# 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
|
||||
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
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "esp-waehlscheibe",
|
||||
"device_id": "esp-waehlscheibe",
|
||||
"name": "HOSTNAME",
|
||||
"device_id": "HOSTNAME",
|
||||
"wifi": {
|
||||
"ssid": "CTDO-IoT",
|
||||
"password": "12345678"
|
||||
"ssid": "WIFI_SSID",
|
||||
"password": "WIFI_PASS"
|
||||
},
|
||||
"mqtt": {
|
||||
"host": "mqtt.ctdo.de",
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/env sh
|
||||
|
||||
device_ip="$1"
|
||||
file="$2"
|
||||
|
||||
curl \
|
||||
--insecure \
|
||||
--no-progress-meter \
|
||||
--fail-with-body \
|
||||
--request POST \
|
||||
--url "https://espota.ctdo.de/" \
|
||||
--header "Content-Type: multipart/form-data" \
|
||||
--form ip="$device_ip" \
|
||||
--form "firmware=@$file" \
|
||||
--no-buffer
|
Loading…
Reference in New Issue