Mercurial > code > home > repos > gcalendarwatch
diff tasks.py @ 14:8c040ebe7b7c
build update
author | drewp@bigasterisk.com |
---|---|
date | Sun, 09 Feb 2020 22:30:32 -0800 |
parents | 1e281ead081a |
children |
line wrap: on
line diff
--- a/tasks.py Sun Feb 09 22:30:18 2020 -0800 +++ b/tasks.py Sun Feb 09 22:30:32 2020 -0800 @@ -1,25 +1,7 @@ -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} .') +from invoke import Collection +import sys +sys.path.append('/my/proj/release') +from serv_tasks import serv_tasks -@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}') +ns = Collection() +serv_tasks(ns, 'serv.n3', 'gcalendarwatch')