Mercurial > code > home > repos > homeauto
changeset 1542:5517f54eaba8
build update
Ignore-this: 1b29ef44c5f6c3c3e8c70f509fbbde66
darcs-hash:e93956d750d152774cbdf63b049051564aaab5bf
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Thu, 13 Feb 2020 10:16:28 -0800 |
parents | d786df082a73 |
children | ab985b87043e |
files | service/wifi/serv.n3 service/wifi/tasks.py |
diffstat | 2 files changed, 7 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/service/wifi/serv.n3 Mon Feb 10 23:58:57 2020 -0800 +++ b/service/wifi/serv.n3 Thu Feb 13 10:16:28 2020 -0800 @@ -3,7 +3,7 @@ @prefix serv: <http://bigasterisk.com/services/> . -serv:wifi a :Service; +serv:wifi a :Service, :NpmPackage; :path "/wifi/"; :openid auth:admin; :serverHost "bang";
--- a/service/wifi/tasks.py Mon Feb 10 23:58:57 2020 -0800 +++ b/service/wifi/tasks.py Thu Feb 13 10:16:28 2020 -0800 @@ -1,39 +1,7 @@ -from invoke import task - -JOB = 'wifi' -PORT = 9070 -TAG = f'bang6:5000/{JOB}_x86:latest' - - -@task -def build(ctx): - ctx.run(f'npm run build', pty=True) - -@task(pre=[build]) -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}') +from invoke import Collection +import sys +sys.path.append('/my/proj/release') +from serv_tasks import serv_tasks -@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 +ns = Collection() +serv_tasks(ns, 'serv.n3', 'wifi')