Mercurial > code > home > repos > homeauto
annotate service/store/tasks.py @ 722:a93fbf0d0daa
dep updates; graph url renames; and other build updates
Ignore-this: 4603ef3d8db650a13e543dad8580ade8
author | drewp@bigasterisk.com |
---|---|
date | Wed, 05 Feb 2020 00:23:06 -0800 |
parents | 2baf1f0994e3 |
children | 98e0695e6ada |
rev | line source |
---|---|
651 | 1 from invoke import task |
2 | |
3 JOB = 'store' | |
4 PORT = 10015 | |
411 | 5 |
651 | 6 TAG = f'bang6:5000/{JOB}_x86:latest' |
411 | 7 |
651 | 8 @task |
9 def build_image(ctx): | |
10 ctx.run(f'docker build --network=host -t {TAG} .') | |
411 | 11 |
651 | 12 @task(pre=[build_image]) |
13 def push_image(ctx): | |
14 ctx.run(f'docker push {TAG}') | |
411 | 15 |
651 | 16 @task |
17 def shell(ctx): | |
18 ctx.run(f'docker run --rm -it --cap-add SYS_PTRACE -v `pwd`:/opt/homeauto_store --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} /bin/bash', pty=True) | |
411 | 19 |
651 | 20 @task(pre=[build_image]) |
21 def local_run(ctx): | |
722
a93fbf0d0daa
dep updates; graph url renames; and other build updates
drewp@bigasterisk.com
parents:
651
diff
changeset
|
22 ctx.run(f'docker run --rm -it -p {PORT}:{PORT} -v `pwd`:/opt/homeauto_store --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} python3 {JOB}.py -v', pty=True) |
411 | 23 |
651 | 24 @task(pre=[push_image]) |
25 def redeploy(ctx): | |
26 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') |