summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 7fdb50d7dfb1df61f874a8b94c627f443947620c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
all: build
install: push

.PHONY: rebuild build push start stop restart bash peer-finder

peer-finder:
	make -C peer-finder

root-galera/usr/bin/peer-finder: peer-finder
	cp peer-finder/peer-finder root-galera/usr/bin/peer-finder

build: Dockerfile root-galera/usr/bin/peer-finder
	docker build --tag chsa/mysql-galera:5.7 .

rebuild: Dockerfile
	docker build --no-cache --tag chsa/mysql-galera:5.7 .

push: build
	docker push chsa/mysql-galera:5.7

login:
	docker login -u `oc whoami` -p `oc whoami -t` docker-registry-default.kaas.kit.edu

kaas: build login
	docker tag chsa/mysql-galera:5.7 docker-registry-default.kaas.kit.edu/adei/mysql-galera:5.7
	docker push docker-registry-default.kaas.kit.edu/adei/mysql-galera:5.7


start: build
	if [ `docker ps | grep chsa/mysql-galera | wc -l` -eq 0 ]; then \
	    if [ `docker ps -a | grep mysql-galera | wc -l` -gt 0 ]; then \
		echo "Removing the stalled copy..." ;\
		docker stop mysql-galera ;\
		docker rm mysql-galera ;\
	    fi ;\
	    docker run --name mysql-galera -t -d chsa/mysql-galera:5.7 ;\
	else \
	    echo "Already running..." ;\
	fi

stop:
	@if [ `docker ps | grep mysql-galera | wc -l` -gt 0 ]; then \
	    docker stop mysql-galera ;\
	    docker rm mysql-galera ;\
	fi

restart:
	make stop
	make start

bash: build
	docker exec -it mysql-galera /bin/bash