view service/wifi/tasks.py @ 1476:817da2dc80fc

kind of running with lit-element and polymer together. lots of data missing from table still Ignore-this: db24e7b633929b01430b0794c1a065dc darcs-hash:cdb1d499a42b869d6affa3ee226f408358a59cf4
author drewp <drewp@bigasterisk.com>
date Sun, 05 Jan 2020 23:18:27 -0800
parents 4bbc68603168
children e188fd8351c0
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'npm run webpack-build', pty=True)
    
@task
def serve_demo(ctx):
    ctx.run('npm run webpack-dev-server')