Mercurial > code > home > repos > homeauto
comparison service/store/tasks.py @ 1452:1dd4da407c0b
build and release config
Ignore-this: a1a0231a2811ac29f906ca72d85a8c34
darcs-hash:879bbda36c705de169b0b746f5c4de467b48d142
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Wed, 25 Sep 2019 17:28:38 -0700 |
parents | |
children | 0da337780f22 |
comparison
equal
deleted
inserted
replaced
1451:71684fc9c692 | 1452:1dd4da407c0b |
---|---|
1 from invoke import task | |
2 | |
3 JOB = 'store' | |
4 PORT = 10015 | |
5 | |
6 TAG = f'bang6:5000/{JOB}_x86:latest' | |
7 | |
8 @task | |
9 def build_image(ctx): | |
10 ctx.run(f'docker build --network=host -t {TAG} .') | |
11 | |
12 @task(pre=[build_image]) | |
13 def push_image(ctx): | |
14 ctx.run(f'docker push {TAG}') | |
15 | |
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) | |
19 | |
20 @task(pre=[build_image]) | |
21 def local_run(ctx): | |
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} python {JOB}.py -v', pty=True) | |
23 | |
24 @task(pre=[push_image]) | |
25 def redeploy(ctx): | |
26 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') |