-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (50 loc) · 1.83 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
58
59
60
61
62
63
64
65
66
# Makefile helper
# Author: Manuel Bernal Llinares <[email protected]>
# Environment
python_folder = python_install
all:
@echo "<===|DEVOPS|===> [INFO] NO DEFAULT target set"
# Installation related targets
install: python_install install_requirements bin tmp logs
@echo "<===|DEVOPS|===> [INSTALL] Platform"
python_install:
@echo "<===|DEVOPS|===> [INSTALL] Preparing Python Virtual Environment"
@pip install --upgrade --user virtualenv
@virtualenv -p `which python3` $(python_folder)
install_requirements:
@echo "<===|DEVOPS|===> [INSTALL] Installing platform requirements"
@#python_install/bin/pip install pipreqs nose
@$(python_folder)/bin/pip install -r requirements.txt
# Folders
tmp:
@echo "<===|DEVOPS|===> [FOLDER] Creating temporary folders"
@mkdir -p tmp/primesdbweb
bin:
@echo "<===|DEVOPS|===> [FOLDER] Creating bin folder"
@mkdir bin
logs:
@echo "<===|DEVOPS|===> [FOLDER] Creating 'logs' folder"
@mkdir logs
# END - Folders
update_requirements_file:
@echo "<===|DEVOPS|===> [REQUIREMENTS] Updating requirements file"
@#python_install/bin/pipreqs --use-local --savepath requirements.txt $(PWD)
@$(python_folder)/bin/pip freeze > requirements.txt
tests:
@echo "<===|DEVOPS|===> [TESTS] Running unit tests"
# Housekeeping
clean_dev:
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning development environment"
@rm -rf $(python_folder)
clean_tmp:
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning temporary folders"
@rm -rf tmp
clean_bin:
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning external binaries"
@rm -rf bin/*
clean: clean_tmp
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning"
clean_all: clean clean_dev
@echo "<===|DEVOPS|===> [HOUSEKEEPING] Cleaning all environments"
# END - Housekeeping
.PHONY: install python_install install_requirements update_requirements_file tests clean_dev clean_all clean_tmp clean_bin clean