summaryrefslogtreecommitdiff
path: root/clustering
diff options
context:
space:
mode:
authorJoe Beda <joe.github@bedafamily.com>2015-01-26 13:50:26 -0800
committerJoe Beda <joe.github@bedafamily.com>2015-01-26 15:25:47 -0800
commit050db5a2f886f39b18cfe36ea768976bb91fdf55 (patch)
tree83aca3c1b1e63013273fd921a4579e1a555cba0f /clustering
parent387b1cb6c62bc61f3cab76b0eba6e201de29e336 (diff)
Add Dockerfile for sequence diagram generation
Diffstat (limited to 'clustering')
-rw-r--r--clustering/Dockerfile12
-rw-r--r--clustering/Makefile13
-rw-r--r--clustering/README.md17
3 files changed, 42 insertions, 0 deletions
diff --git a/clustering/Dockerfile b/clustering/Dockerfile
new file mode 100644
index 00000000..3353419d
--- /dev/null
+++ b/clustering/Dockerfile
@@ -0,0 +1,12 @@
+FROM debian:jessie
+
+RUN apt-get update
+RUN apt-get -qy install python-seqdiag make curl
+
+WORKDIR /diagrams
+
+RUN curl -sLo DroidSansMono.ttf https://googlefontdirectory.googlecode.com/hg/apache/droidsansmono/DroidSansMono.ttf
+
+ADD . /diagrams
+
+CMD bash -c 'make >/dev/stderr && tar cf - *.png' \ No newline at end of file
diff --git a/clustering/Makefile b/clustering/Makefile
index 298479f1..f6aa53ed 100644
--- a/clustering/Makefile
+++ b/clustering/Makefile
@@ -14,3 +14,16 @@ $(FONT):
%.png: %.seqdiag $(FONT)
seqdiag --no-transparency -a -f '$(FONT)' $<
+
+# Build the stuff via a docker image
+.PHONY: docker
+docker:
+ docker build -t clustering-seqdiag .
+ docker run --rm clustering-seqdiag | tar xvf -
+
+docker-clean:
+ docker rmi clustering-seqdiag || true
+ docker images -q --filter "dangling=true" | xargs docker rmi
+
+fix-clock-skew:
+ boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(shell date -u +%Y%m%d%H%M.%S)"
diff --git a/clustering/README.md b/clustering/README.md
index 04abb1bc..7e9d79c8 100644
--- a/clustering/README.md
+++ b/clustering/README.md
@@ -7,3 +7,20 @@ pip install seqdiag
```
Just call `make` to regenerate the diagrams.
+
+## Building with Docker
+If you are on a Mac or your pip install is messed up, you can easily build with docker.
+
+```
+make docker
+```
+
+The first run will be slow but things should be fast after that.
+
+To clean up the docker containers that are created (and other cruft that is left around) you can run `make docker-clean`.
+
+If you are using boot2docker and get warnings about clock skew (or if things aren't building for some reason) then you can fix that up with `make fix-clock-skew`.
+
+## Automatically rebuild on file changes
+
+If you have the fswatch utility installed, you can have it monitor the file system and automatically rebuild when files have changed. Just do a `make watch`. \ No newline at end of file