view espNode/tasks.py @ 1529:0e0713fd23e7

build: place generated nim in its own dir Ignore-this: 89c9a75595f0465d4efc44ef1b96abd7 darcs-hash:6a695011fe841ce7d6c020ebc33b6099ff26d964
author drewp <drewp@bigasterisk.com>
date Thu, 23 Jan 2020 23:59:41 -0800
parents ed3d29eb989a
children
line wrap: on
line source

from invoke import task

tag = 'esphome/esphome:dev'

@task
def pull_esphome(ctx):
    ctx.run(f"docker pull {tag}")

@task
def program_board_over_usb(ctx, board):
    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts --device=/dev/ttyUSB0 -it {tag} {board}.yaml run", pty=True)

@task
def program_board_over_wifi(ctx, board):
    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts -it --net=host {tag} {board}.yaml run", pty=True)

@task
def monitor_usb(ctx, board):
    ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} {board}.yaml logs", pty=True)

# device up?
#  nmap -Pn -p 3232,6053 10.2.0.21