summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ba48592
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+all: build
+install: push
+
+.PHONY: rebuild build push start stop restart bash logs
+
+build: Dockerfile
+ docker build --tag chsa/distcc:latest .
+
+rebuild: Dockerfile
+ docker build --no-cache --tag chsa/distcc:latest .
+
+push: build
+ docker push chsa/distcc:latest
+
+start: build
+ if [ `docker ps | grep chsa/distcc | wc -l` -eq 0 ]; then \
+ if [ `docker ps -a | grep distccd | wc -l` -gt 0 ]; then \
+ echo "Removing the stalled copy..." ;\
+ docker rm distccd ;\
+ fi ;\
+ docker run -p 0.0.0.0:3632:3632 --name distccd -t -d chsa/distcc:latest ;\
+ else \
+ echo "Already running..." ;\
+ fi
+
+stop:
+ @if [ `docker ps | grep distccd | wc -l` -gt 0 ]; then \
+ docker stop distccd ;\
+ docker rm distccd ;\
+ fi
+
+restart:
+ make stop
+ make start
+
+debug: build
+ docker rm distccd ;\
+ docker run -p 0.0.0.0:3632:3632 --name distccd -it chsa/distcc:latest /bin/bash
+
+bash: build
+ docker exec -it distccd /bin/bash
+
+logs:
+ docker logs distccd
+