comparison service/frontDoorLock/tasks.py @ 1370:a6902e4587f6

update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming Ignore-this: 106acca04ac1012ac21a434692a4d515 darcs-hash:2f54636654af549b195ed8c1aaec8c12406a5eec
author drewp <drewp@bigasterisk.com>
date Sun, 05 May 2019 22:43:14 -0700
parents 5836e88a0287
children fecbac537f63
comparison
equal deleted inserted replaced
1369:42f4fed9cd25 1370:a6902e4587f6
1 from invoke import task 1 from invoke import task
2
3 2
4 JOB = 'front_door_lock' 3 JOB = 'front_door_lock'
5 PORT = 10011 4 PORT = 10011
6 TAG = f'bang6:5000/{JOB}_x86:latest' 5 TAG = f'bang6:5000/{JOB}_x86:latest'
7 ANSIBLE_TAG = 'door' 6 ANSIBLE_TAG = 'door'
24 23
25 @task(pre=[push_image]) 24 @task(pre=[push_image])
26 def redeploy(ctx): 25 def redeploy(ctx):
27 ctx.run(f'sudo /my/proj/ansible/playbook -l bang -t {ANSIBLE_TAG}') 26 ctx.run(f'sudo /my/proj/ansible/playbook -l bang -t {ANSIBLE_TAG}')
28 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') 27 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}')
28
29 @task
30 def program_board_over_usb(ctx):
31 tag = 'esphome/esphome'
32 ctx.run(f"docker pull {tag}")
33 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml run", pty=True)
34
35 @task
36 def monitor_usb(ctx):
37 tag = 'esphome/esphome'
38 ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml logs", pty=True)