Mercurial > code > home > repos > homeauto
annotate service/wifi/tasks.py @ 662:540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
Ignore-this: ef4e6fdf3369939b062caa5fdc2788e9
author | drewp@bigasterisk.com |
---|---|
date | Tue, 17 Dec 2019 23:16:53 -0800 |
parents | d0830394bf7b |
children | f424809cba8d |
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 | |
7 @task | |
8 def build_image(ctx): | |
9 ctx.run(f'docker build --network=host -t {TAG} .') | |
383 | 10 |
564 | 11 @task(pre=[build_image]) |
12 def push_image(ctx): | |
13 ctx.run(f'docker push {TAG}') | |
14 | |
15 @task(pre=[build_image]) | |
16 def shell(ctx): | |
17 ctx.run(f'docker run --name {JOB}_shell --rm -it --cap-add SYS_PTRACE --net=host {TAG} /bin/bash', pty=True) | |
383 | 18 |
564 | 19 @task(pre=[build_image]) |
20 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
|
21 ctx.run(f'docker run --name {JOB}_local --rm -it --net=host -v `pwd`:/opt {TAG} python3 wifi.py -v', pty=True) |
421 | 22 |
564 | 23 @task(pre=[push_image]) |
24 def redeploy(ctx): | |
25 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
|
26 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
27 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
28 # 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
|
29 # 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
|
30 # 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
|
31 # 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
|
32 # 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
|
33 |
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 run webpack-cli --config webpack.config.js --mode production |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
35 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
36 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
37 @task |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
38 def build(ctx): |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
39 ctx.run(f'yarn webpack-build', pty=True) # --debug --display-error-details |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
40 |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
41 @task |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
42 def serve_demo(ctx): |
540dd68af9f2
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
564
diff
changeset
|
43 ctx.run('node_modules/.bin/webpack-dev-server --config webpack-dev.config.ts --port 8082 --verbose --color') |