summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 23813283802733c45555dda523eca123bdda3dbc (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
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

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

kaas: build login
	docker tag chsa/centos-tools:latest docker-registry-default.kaas.kit.edu/kaas/kaas-manager:latest
	docker push docker-registry-default.kaas.kit.edu/kaas/kaas-manager: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