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