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