Mercurial > code > home > repos > homeauto
view 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 |
line wrap: on
line source
from invoke import task JOB = 'wifi' PORT = 9070 TAG = f'bang6:5000/{JOB}_x86:latest' @task def build_image(ctx): ctx.run(f'docker build --network=host -t {TAG} .') @task(pre=[build_image]) def push_image(ctx): ctx.run(f'docker push {TAG}') @task(pre=[build_image]) def shell(ctx): ctx.run(f'docker run --name {JOB}_shell --rm -it --cap-add SYS_PTRACE --net=host {TAG} /bin/bash', pty=True) @task(pre=[build_image]) def local_run(ctx): ctx.run(f'docker run --name {JOB}_local --rm -it --net=host -v `pwd`:/opt {TAG} python3 wifi.py -v', pty=True) @task(pre=[push_image]) def redeploy(ctx): ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') # one time: # yarn policies set-version v2 # and for vscode: # yarn pnpify --sdk # then pick the pnp one on statusbar. #yarn run webpack-cli --config webpack.config.js --mode production @task def build(ctx): ctx.run(f'yarn webpack-build', pty=True) # --debug --display-error-details @task def serve_demo(ctx): ctx.run('node_modules/.bin/webpack-dev-server --config webpack-dev.config.ts --port 8082 --verbose --color')