summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-28 02:54:00 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-28 02:54:00 +0100
commita4f8f68f2604096de935f3a20ea230b95e0eb130 (patch)
tree58796e0c6aa1b0281fa711491cfdc09a59588741 /Makefile
downloadands-management-a4f8f68f2604096de935f3a20ea230b95e0eb130.tar.gz
ands-management-a4f8f68f2604096de935f3a20ea230b95e0eb130.tar.bz2
ands-management-a4f8f68f2604096de935f3a20ea230b95e0eb130.tar.xz
ands-management-a4f8f68f2604096de935f3a20ea230b95e0eb130.zip
Initial import
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..34badf0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+all: build
+install: push
+
+.PHONY: rebuild build push start stop restart bash
+
+build: Dockerfile
+ docker build --tag chsa/centos-tools:latest .
+
+rebuild: Dockerfile
+ docker build --no-cache --tag chsa/centos-tools:latest .
+
+push: build
+ docker push chsa/centos-tools:latest
+
+start: build
+ if [ `docker ps | grep chsa/centos-tools | wc -l` -eq 0 ]; then \
+ if [ `docker ps -a | grep centos-tools | wc -l` -gt 0 ]; then \
+ echo "Removing the stalled copy..." ;\
+ docker stop centos-tools ;\
+ docker rm centos-tools ;\
+ fi ;\
+ docker run --name centos-tools -t -d chsa/centos-tools:latest ;\
+ else \
+ echo "Already running..." ;\
+ fi
+
+stop:
+ @if [ `docker ps | grep centos-tools | wc -l` -gt 0 ]; then \
+ docker stop centos-tools ;\
+ docker rm centos-tools ;\
+ fi
+
+restart:
+ make stop
+ make start
+
+bash: build
+ docker exec -it centos-tools /bin/bash