changeset 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 71684fc9c692
children ea942d383f62
files service/store/Dockerfile service/store/makefile service/store/requirements.txt service/store/tasks.py
diffstat 4 files changed, 33 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/service/store/Dockerfile	Wed Sep 25 17:27:35 2019 -0700
+++ b/service/store/Dockerfile	Wed Sep 25 17:28:38 2019 -0700
@@ -3,7 +3,7 @@
 WORKDIR /opt
 
 COPY requirements.txt ./
-RUN pip install -r requirements.txt
+RUN pip install --index-url https://projects.bigasterisk.com/ --extra-index-url https://pypi.org/simple -r requirements.txt
 
 COPY *.py *.html ./
 
--- a/service/store/makefile	Wed Sep 25 17:27:35 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-JOB=store
-PORT=10015
-
-TAG=bang6:5000/${JOB}_x86:latest
-
-push_x86:
-	docker push ${TAG}
-
-build_x86:
-	rm -rf tmp_ctx
-	mkdir -p tmp_ctx
-	cp -a Dockerfile ../../lib/*.py *.py *.txt *.html tmp_ctx
-	docker build --network=host -t ${TAG} tmp_ctx
-	rm -rf tmp_ctx
-
-build_image: build_x86 push_x86
-
-shell:
-	docker run --rm -it --cap-add SYS_PTRACE --net=host $(TAG) /bin/sh
-
-local_run: build_x86
-	docker run --rm -it -v `pwd`/index.html:/opt/index.html -v `pwd`:/opt/homeauto_store bang6:5000/store_x86:latest python ./store.py -v
-
-redeploy: build_image
-	supervisorctl restart $(JOB)_$(PORT)
--- a/service/store/requirements.txt	Wed Sep 25 17:27:35 2019 -0700
+++ b/service/store/requirements.txt	Wed Sep 25 17:28:38 2019 -0700
@@ -3,3 +3,9 @@
 https://projects.bigasterisk.com/rdfdb/rdfdb-0.8.0.tar.gz
 rdflib-jsonld==0.3
 git+http://github.com/drewp/scales.git@448d59fb491b7631877528e7695a93553bfaaa93#egg=scales
+
+cycloneerr
+patchablegraph==0.5.0
+rdfdb==0.8.0
+standardservice==0.6.0
+patchablegraph==0.5.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/service/store/tasks.py	Wed Sep 25 17:28:38 2019 -0700
@@ -0,0 +1,26 @@
+from invoke import task
+
+JOB = 'store'
+PORT = 10015
+
+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
+def shell(ctx):
+    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)
+
+@task(pre=[build_image])
+def local_run(ctx):
+    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)
+
+@task(pre=[push_image])
+def redeploy(ctx):
+    ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}')