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