-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (48 loc) · 1.55 KB
/
Makefile
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
53
54
55
56
57
VENV ?= ./.superduperminikuber
PYTHON_EXE ?= python3
PYTHON_OK := $(shell type -P ${PYTHON_EXE})
KUBECTL_OK := $(shell type -P kubectl)
MINIKUBE_OK := $(shell type -P minikube)
check_kubectl:
@echo '*********** Checking for kubectl installation **********'
ifeq ('$(KUBECTL_OK)','')
$(error package 'kubectl' not found!)
else
@echo Found kubectl!
endif
check_minikube:
@echo '*********** Checking for minkube installation **********'
ifeq ('$(MINIKUBE_OK)','')
$(error package 'minikube' not found!)
else
@echo Found minikube!
endif
check_python:
@echo '*********** Checking for Python installation ***********'
ifeq ('$(PYTHON_OK)','')
$(error python interpreter: '${PYTHON_EXE}' not found!)
else
@echo Found Python
endif
setup_venv: check_python
@echo '****** Creating virtualenv and installing Ansible ******'
${PYTHON_EXE} -m venv $(VENV)
${VENV}/bin/pip install --upgrade pip
${VENV}/bin/pip install -r requirements-dev.txt
@echo '*************** Installation Complete ******************'
setup_minikube: check_minikube
@echo '****** Setting up Minikube ******'
minikube stop
minikube delete
minikube start
install: setup_venv setup_minikube
test: check_python
find . -type f -name '*.pyc' -delete
${VENV}/bin/pytest -s --cov=./helloworld --no-cov-on-fail --cov-config=.coveragerc ./helloworld
run_ansible: check_kubectl check_minikube
minikube start
${VENV}/bin/ansible-playbook -i inventory.cfg helloworld.yml
clean: check_minikube check_python
minikube stop
minikube delete
rm -rf ${VENV}