Mercurial > code > home > repos > gcalendarwatch
view tasks.py @ 12:ade2cc9067a9
upgrade patchablegraph to preview graph in browser
author | drewp@bigasterisk.com |
---|---|
date | Tue, 04 Feb 2020 00:19:25 -0800 |
parents | 1e281ead081a |
children | 8c040ebe7b7c |
line wrap: on
line source
from invoke import task JOB = 'gcalendarwatch' PORT = 9105 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 {TAG} python3 gcalendarwatch.py -v --now', pty=True) @task(pre=[push_image]) def redeploy(ctx): ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}')