diff service/dhcpleases/tasks.py @ 745:d7e82b1b31c4

build updates Ignore-this: 778aa92957159f60aa3b1c75d1a51dfd
author drewp@bigasterisk.com
date Thu, 13 Feb 2020 10:19:22 -0800
parents f372e9d358d2
children
line wrap: on
line diff
--- a/service/dhcpleases/tasks.py	Thu Feb 13 10:17:54 2020 -0800
+++ b/service/dhcpleases/tasks.py	Thu Feb 13 10:19:22 2020 -0800
@@ -1,27 +1,7 @@
-from invoke import task
-
-JOB = 'dhcpleases'
-PORT = 9073
-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 --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 --rm -it -p {PORT}:{PORT} --net=host -v /opt/dnsmasq:/opt/dnsmasq {TAG} python3 dhcpleases.py -v', pty=True)
-
-@task(pre=[push_image])
-def redeploy(ctx):
-    ctx.run(f'sudo /my/proj/ansible/playbook -l bang -t {JOB}')
-    ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}')
+ns = Collection()
+serv_tasks(ns, 'serv.n3', 'dhcpLeases')