Mercurial > code > home > repos > homeauto
comparison service/reasoning/tasks.py @ 1523:0da337780f22
dep updates; graph url renames; and other build updates
Ignore-this: 4603ef3d8db650a13e543dad8580ade8
darcs-hash:0840491cd6a4e4966f47a2abca0ed30ec434022a
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Wed, 05 Feb 2020 00:23:06 -0800 |
parents | 21d0cd98ef7a |
children | d36d3b9ae516 |
comparison
equal
deleted
inserted
replaced
1522:040e12a696a9 | 1523:0da337780f22 |
---|---|
13 def push_image(ctx): | 13 def push_image(ctx): |
14 ctx.run(f'docker push {TAG}') | 14 ctx.run(f'docker push {TAG}') |
15 | 15 |
16 @task | 16 @task |
17 def shell(ctx): | 17 def shell(ctx): |
18 ctx.run(f'docker run --rm -it --cap-add SYS_PTRACE -v `pwd`:/mnt --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} /bin/bash', pty=True) | 18 ctx.run(f'docker run --name {JOB}_shell --rm -it --cap-add SYS_PTRACE -v `pwd`:/mnt --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} /bin/bash', pty=True) |
19 | 19 |
20 @task(pre=[build_image]) | 20 @task(pre=[build_image]) |
21 def local_run(ctx): | 21 def local_run(ctx): |
22 ctx.run(f'docker run --rm -it -p {PORT}:{PORT} -v `pwd`:/mnt --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} python /mnt/{JOB}.py -iro', pty=True) | 22 ctx.run(f'docker run --name {JOB}_local --rm -it ' |
23 f'-p {PORT}:{PORT} ' | |
24 f'-v `pwd`:/mnt ' | |
25 f'-v `pwd`/index.html:/opt/index.html ' | |
26 f'--dns 10.2.0.1 --dns-search bigasterisk.com ' | |
27 f'--net=host ' | |
28 f'{TAG} ' | |
29 f'python /mnt/{JOB}.py -iro', pty=True) | |
23 | 30 |
24 @task(pre=[build_image]) | 31 @task(pre=[build_image]) |
25 def local_run_mock(ctx): | 32 def local_run_mock(ctx): |
26 ctx.run(f'docker run --rm -it -p {PORT}:{PORT} -v `pwd`:/mnt --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} python /mnt/{JOB}.py -iro --mockoutput', pty=True) | 33 ctx.run(f'docker run --name {JOB}_local_run_mock --rm -it -p {PORT}:{PORT} -v `pwd`:/mnt --dns 10.2.0.1 --dns-search bigasterisk.com --net=host {TAG} python /mnt/{JOB}.py -iro --mockoutput', pty=True) |
27 | 34 |
28 @task(pre=[push_image]) | 35 @task(pre=[push_image]) |
29 def redeploy(ctx): | 36 def redeploy(ctx): |
30 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') | 37 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') |