Mercurial > code > home > repos > homeauto
annotate service/wifi/tasks.py @ 712:d98c3ffe7144
new graph output for browsers, with autorefresh
Ignore-this: e4ff4dbed311b238d90988a1891ef640
author | drewp@bigasterisk.com |
---|---|
date | Mon, 03 Feb 2020 23:47:23 -0800 |
parents | 50d66febeeb0 |
children | 632a88c27b11 |
rev | line source |
---|---|
564 | 1 from invoke import task |
383 | 2 |
564 | 3 JOB = 'wifi' |
4 PORT = 9070 | |
5 TAG = f'bang6:5000/{JOB}_x86:latest' | |
6 | |
683 | 7 |
564 | 8 @task |
683 | 9 def build(ctx): |
10 ctx.run(f'npm run build', pty=True) | |
11 | |
12 @task(pre=[build]) | |
564 | 13 def build_image(ctx): |
14 ctx.run(f'docker build --network=host -t {TAG} .') | |
383 | 15 |
564 | 16 @task(pre=[build_image]) |
17 def push_image(ctx): | |
18 ctx.run(f'docker push {TAG}') | |
19 | |
20 @task(pre=[build_image]) | |
21 def shell(ctx): | |
22 ctx.run(f'docker run --name {JOB}_shell --rm -it --cap-add SYS_PTRACE --net=host {TAG} /bin/bash', pty=True) | |
383 | 23 |
564 | 24 @task(pre=[build_image]) |
25 def local_run(ctx): | |
662
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
26 ctx.run(f'docker run --name {JOB}_local --rm -it --net=host -v `pwd`:/opt {TAG} python3 wifi.py -v', pty=True) |
421 | 27 |
564 | 28 @task(pre=[push_image]) |
29 def redeploy(ctx): | |
30 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') | |
662
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
31 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
32 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
33 # one time: |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
34 # yarn policies set-version v2 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
35 # and for vscode: |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
36 # yarn pnpify --sdk |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
37 # then pick the pnp one on statusbar. |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
38 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
39 #yarn run webpack-cli --config webpack.config.js --mode production |