Mercurial > code > home > repos > homeauto
annotate service/wifi/tasks.py @ 1473:4bbc68603168
npm run build works now, accessing streamed-graph. But, s-g isn't in the output bundle yet.
Ignore-this: 2b08220ad8d275f4dd242c3aa1a8647a
darcs-hash:713c0960d19658e35685d64dc855ca63e1fde660
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 29 Dec 2019 19:41:48 -0800 |
parents | 32d134dbfb1e |
children | e188fd8351c0 |
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): |
1473
4bbc68603168
npm run build works now, accessing streamed-graph. But, s-g isn't in the output bundle yet.
drewp <drewp@bigasterisk.com>
parents:
1464
diff
changeset
|
39 ctx.run(f'npm run webpack-build', pty=True) |
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
|
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): |
1473
4bbc68603168
npm run build works now, accessing streamed-graph. But, s-g isn't in the output bundle yet.
drewp <drewp@bigasterisk.com>
parents:
1464
diff
changeset
|
43 ctx.run('npm run webpack-dev-server') |