Mercurial > code > home > repos > homeauto
annotate service/wifi/tasks.py @ 1464:32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
Ignore-this: ef4e6fdf3369939b062caa5fdc2788e9
darcs-hash:e30e71ea5e8e9958c254c9210cdccde7a74b96bb
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 17 Dec 2019 23:16:53 -0800 |
parents | b287950fbcf4 |
children | 4bbc68603168 |
rev | line source |
---|---|
1367 | 1 from invoke import task |
2 | |
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} .') | |
10 | |
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) | |
18 | |
19 @task(pre=[build_image]) | |
20 def local_run(ctx): | |
1464
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
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) |
1367 | 22 |
23 @task(pre=[push_image]) | |
24 def redeploy(ctx): | |
25 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') | |
1464
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
26 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
27 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
28 # one time: |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
29 # yarn policies set-version v2 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
30 # and for vscode: |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
31 # yarn pnpify --sdk |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
32 # then pick the pnp one on statusbar. |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
33 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
34 #yarn run webpack-cli --config webpack.config.js --mode production |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
35 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
36 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
37 @task |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
38 def build(ctx): |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
39 ctx.run(f'yarn webpack-build', pty=True) # --debug --display-error-details |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
40 |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
41 @task |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
42 def serve_demo(ctx): |
32d134dbfb1e
start ts config files, but this doesn't share the streamed-graph code properly yet
drewp <drewp@bigasterisk.com>
parents:
1367
diff
changeset
|
43 ctx.run('node_modules/.bin/webpack-dev-server --config webpack-dev.config.ts --port 8082 --verbose --color') |