---
kind: pipeline
type: exec
name: upload gateway firmare

platform:
  os: linux
  arch: arm

steps:
- name: upload
  commands:
  - cd gateway
  - pio run -e pro-mini
  - echo -n 'reset' > /dev/ttyUSB0; sleep 1s; avrdude -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:.pio/build/pro-mini/firmware.hex:i -v
  when:
    target:
    - production

trigger:
  branch:
  - gateway

node:
  host: homebox
