Mercurial > code > home > repos > homeauto
annotate service/wifi/tasks.py @ 1484:e188fd8351c0
build cleanup and reformats
Ignore-this: dcb2bb4a86eee1a298c644e0f81a7d0d
darcs-hash:336acbaea2737a508bc9cfcfaaac3c3671835504
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 06 Jan 2020 23:47:30 -0800 |
parents | 4bbc68603168 |
children | 5517f54eaba8 |
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 | |
1484 | 7 |
1367 | 8 @task |
1484 | 9 def build(ctx): |
10 ctx.run(f'npm run build', pty=True) | |
11 | |
12 @task(pre=[build]) | |
1367 | 13 def build_image(ctx): |
14 ctx.run(f'docker build --network=host -t {TAG} .') | |
15 | |
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) | |
23 | |
24 @task(pre=[build_image]) | |
25 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
|
26 ctx.run(f'docker run --name {JOB}_local --rm -it --net=host -v `pwd`:/opt {TAG} python3 wifi.py -v', pty=True) |
1367 | 27 |
28 @task(pre=[push_image]) | |
29 def redeploy(ctx): | |
30 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
|
31 |
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 |
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 # 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
|
34 # 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
|
35 # 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
|
36 # 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
|
37 # 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
|
38 |
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 #yarn run webpack-cli --config webpack.config.js --mode production |