##// END OF EJS Templates
makefile: always cleanup build dir
super-admin -
r1134:d88b9a35 default
parent child Browse files
Show More
@@ -1,111 +1,112 b''
1 1 # required for pushd to work..
2 2 #SHELL = /bin/bash
3 3
4 4
5 5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
6 6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
7 7
8 8 .PHONY: clean
9 9 ## Cleanup compiled and cache py files
10 10 clean:
11 11 make test-clean
12 12 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
13 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
13 14
14 15
15 16 .PHONY: test
16 17 ## run test-clean and tests
17 18 test:
18 19 make test-clean
19 20 make test-only
20 21
21 22
22 23 .PHONY: test-clean
23 24 ## run test-clean and tests
24 25 test-clean:
25 26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
26 27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
27 28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
28 29
29 30
30 31 .PHONY: test-only
31 32 ## Run tests only without cleanup
32 33 test-only:
33 34 PYTHONHASHSEED=random \
34 35 py.test -x -vv -r xw -p no:sugar \
35 36 --cov-report=term-missing --cov-report=html \
36 37 --cov=vcsserver vcsserver
37 38
38 39
39 40 .PHONY: pip-packages
40 41 ## Show outdated packages
41 42 pip-packages:
42 43 python ${OUTDATED_PACKAGES}
43 44
44 45
45 46 .PHONY: build
46 47 ## Build sdist/egg
47 48 build:
48 49 python -m build
49 50
50 51
51 52 .PHONY: dev-env
52 53 ## make dev-env based on the requirements files and install develop of packages
53 54 dev-env:
54 55 pip install build virtualenv
55 56 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
56 57 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
57 58 pip install -e .
58 59
59 60
60 61 .PHONY: dev-srv
61 62 ## run develop server instance
62 63 dev-srv:
63 64 pserve --reload .dev/dev.ini
64 65
65 66
66 67 .PHONY: dev-srv-g
67 68 ## run gunicorn multi process workers
68 69 dev-srv-g:
69 70 gunicorn --workers=4 --paste .dev/dev.ini --bind=0.0.0.0:10010 --worker-class=sync --threads=1 --config=configs/gunicorn_config.py --timeout=120
70 71
71 72 # Default command on calling make
72 73 .DEFAULT_GOAL := show-help
73 74
74 75 .PHONY: show-help
75 76 show-help:
76 77 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
77 78 @echo
78 79 @sed -n -e "/^## / { \
79 80 h; \
80 81 s/.*//; \
81 82 :doc" \
82 83 -e "H; \
83 84 n; \
84 85 s/^## //; \
85 86 t doc" \
86 87 -e "s/:.*//; \
87 88 G; \
88 89 s/\\n## /---/; \
89 90 s/\\n/ /g; \
90 91 p; \
91 92 }" ${MAKEFILE_LIST} \
92 93 | LC_ALL='C' sort --ignore-case \
93 94 | awk -F '---' \
94 95 -v ncol=$$(tput cols) \
95 96 -v indent=19 \
96 97 -v col_on="$$(tput setaf 6)" \
97 98 -v col_off="$$(tput sgr0)" \
98 99 '{ \
99 100 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
100 101 n = split($$2, words, " "); \
101 102 line_length = ncol - indent; \
102 103 for (i = 1; i <= n; i++) { \
103 104 line_length -= length(words[i]) + 1; \
104 105 if (line_length <= 0) { \
105 106 line_length = ncol - indent - length(words[i]) - 1; \
106 107 printf "\n%*s ", -indent, " "; \
107 108 } \
108 109 printf "%s ", words[i]; \
109 110 } \
110 111 printf "\n"; \
111 112 }'
General Comments 0
You need to be logged in to leave comments. Login now