##// END OF EJS Templates
makefile: updated with latest changes, added gunicorn serve
super-admin -
r5036:608b489e default
parent child Browse files
Show More
@@ -1,156 +1,171 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 NODE_PATH=./node_modules
8 NODE_PATH=./node_modules
7 WEBPACK=./node_binaries/webpack
9 WEBPACK=./node_binaries/webpack
8 GRUNT=./node_binaries/grunt
10 GRUNT=./node_binaries/grunt
9
11
10 .PHONY: clean
12 .PHONY: clean
11 ## Cleanup compiled and cache py files
13 ## Cleanup compiled and cache py files
12 clean:
14 clean:
13 make test-clean
15 make test-clean
14 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
16 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
15
17
16
18
17 .PHONY: test
19 .PHONY: test
18 ## run test-clean and tests
20 ## run test-clean and tests
19 test:
21 test:
20 make test-clean
22 make test-clean
21 make test-only
23 make test-only
22
24
23
25
24 .PHONY:test-clean
26 .PHONY: test-clean
25 ## run test-clean and tests
27 ## run test-clean and tests
26 test-clean:
28 test-clean:
27 rm -rf coverage.xml htmlcov junit.xml pylint.log result
29 rm -rf coverage.xml htmlcov junit.xml pylint.log result
28 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
30 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
29 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
31 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
30
32
31
33
32 .PHONY: test-only
34 .PHONY: test-only
33 ## Run tests only without cleanup
35 ## Run tests only without cleanup
34 test-only:
36 test-only:
35 PYTHONHASHSEED=random \
37 PYTHONHASHSEED=random \
36 py.test -x -vv -r xw -p no:sugar \
38 py.test -x -vv -r xw -p no:sugar \
37 --cov-report=term-missing --cov-report=html \
39 --cov-report=term-missing --cov-report=html \
38 --cov=rhodecode rhodecode
40 --cov=rhodecode rhodecode
39
41
42
40 .PHONY: test-only-mysql
43 .PHONY: test-only-mysql
41 ## run tests against mysql
44 ## run tests against mysql
42 test-only-mysql:
45 test-only-mysql:
43 PYTHONHASHSEED=random \
46 PYTHONHASHSEED=random \
44 py.test -x -vv -r xw -p no:sugar \
47 py.test -x -vv -r xw -p no:sugar \
45 --cov-report=term-missing --cov-report=html \
48 --cov-report=term-missing --cov-report=html \
46 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
49 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
47 --cov=rhodecode rhodecode
50 --cov=rhodecode rhodecode
48
51
49
52
50 .PHONY: test-only-postgres
53 .PHONY: test-only-postgres
51 ## run tests against postgres
54 ## run tests against postgres
52 test-only-postgres:
55 test-only-postgres:
53 PYTHONHASHSEED=random \
56 PYTHONHASHSEED=random \
54 py.test -x -vv -r xw -p no:sugar \
57 py.test -x -vv -r xw -p no:sugar \
55 --cov-report=term-missing --cov-report=html \
58 --cov-report=term-missing --cov-report=html \
56 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
59 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
57 --cov=rhodecode rhodecode
60 --cov=rhodecode rhodecode
58
61
59 .PHONY: docs
62 .PHONY: docs
60 ## build docs
63 ## build docs
61 docs:
64 docs:
62 (cd docs; nix-build default.nix -o result; make clean html)
65 (cd docs; nix-build default.nix -o result; make clean html)
63
66
64
67
65 .PHONY: docs-clean
68 .PHONY: docs-clean
66 ## Cleanup docs
69 ## Cleanup docs
67 docs-clean:
70 docs-clean:
68 (cd docs; make clean)
71 (cd docs; make clean)
69
72
70
73
71 .PHONY: docs-cleanup
74 .PHONY: docs-cleanup
72 ## Cleanup docs
75 ## Cleanup docs
73 docs-cleanup:
76 docs-cleanup:
74 (cd docs; make cleanup)
77 (cd docs; make cleanup)
75
78
76
79
77 .PHONY: web-build
80 .PHONY: web-build
78 ## Build JS packages static/js
81 ## Build JS packages static/js
79 web-build:
82 web-build:
80 NODE_PATH=$(NODE_PATH) $(GRUNT)
83 NODE_PATH=$(NODE_PATH) $(GRUNT)
81
84
82 # check required files
85 # check required files
83 STATIC_CHECK="/robots.txt /502.html \
86 STATIC_CHECK="/robots.txt /502.html \
84 /js/scripts.min.js /js/rhodecode-components.js \
87 /js/scripts.min.js /js/rhodecode-components.js \
85 /css/style.css /css/style-polymer.css /css/style-ipython.css"
88 /css/style.css /css/style-polymer.css /css/style-ipython.css"
86
89
87 for file in $STATIC_CHECK;
90 for file in $STATIC_CHECK;
88 do
91 do
89 if [ ! -f rhodecode/public/$file ]; then
92 if [ ! -f rhodecode/public/$file ]; then
90 echo "Missing $file expected after web-build"
93 echo "Missing $file expected after web-build"
91 exit 1
94 exit 1
92 fi
95 fi
93 done
96 done
94
97
95 .PHONY: pip-packages
98 .PHONY: pip-packages
96 ## show outdated packages
99 ## Show outdated packages
97 pip-packages:
100 pip-packages:
98 python ${OUTDATED_PACKAGES}
101 python ${OUTDATED_PACKAGES}
99
102
100
103
101 .PHONY: sdist
104 .PHONY: build
102 ## Build sdist
105 ## Build sdist/egg
103 sdist:
106 build:
104 python setup.py sdist
107 python -m build
105
108
106
109
107 .PHONY: dev-env
110 .PHONY: dev-env
108 ## make dev-env based on the requirements files and install develop of packages
111 ## make dev-env based on the requirements files and install develop of packages
109 dev-env:
112 dev-env:
113 pip install build virtualenv
110 pushd ../rhodecode-vcsserver/ && make dev-env && popd
114 pushd ../rhodecode-vcsserver/ && make dev-env && popd
111 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
115 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_rc_tools.txt -r requirements_test.txt -r requirements_debug.txt
112 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
116 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_rc_tools.txt -r requirements_test.txt -r requirements_debug.txt
113 pip install -e .
117 pip install -e .
114
118
119
120 .PHONY: dev-srv
121 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
122 dev-srv:
123 pserve --reload .dev/dev.ini
124
125 .PHONY: dev-srv-g
126 ## run gunicorn multi process workers
127 dev-srv-g:
128 gunicorn --workers=4 --paste .dev/dev_g.ini --bind=0.0.0.0:10020 --worker-class=gevent --threads=1 --config=configs/gunicorn_config.py --timeout=120
129
130
115 # Default command on calling make
131 # Default command on calling make
116 .DEFAULT_GOAL := show-help
132 .DEFAULT_GOAL := show-help
117
133
118 .PHONY: show-help
134 .PHONY: show-help
119 show-help:
135 show-help:
120 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
136 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
121 @echo
137 @echo
122 @sed -n -e "/^## / { \
138 @sed -n -e "/^## / { \
123 h; \
139 h; \
124 s/.*//; \
140 s/.*//; \
125 :doc" \
141 :doc" \
126 -e "H; \
142 -e "H; \
127 n; \
143 n; \
128 s/^## //; \
144 s/^## //; \
129 t doc" \
145 t doc" \
130 -e "s/:.*//; \
146 -e "s/:.*//; \
131 G; \
147 G; \
132 s/\\n## /---/; \
148 s/\\n## /---/; \
133 s/\\n/ /g; \
149 s/\\n/ /g; \
134 p; \
150 p; \
135 }" ${MAKEFILE_LIST} \
151 }" ${MAKEFILE_LIST} \
136 | LC_ALL='C' sort --ignore-case \
152 | LC_ALL='C' sort --ignore-case \
137 | awk -F '---' \
153 | awk -F '---' \
138 -v ncol=$$(tput cols) \
154 -v ncol=$$(tput cols) \
139 -v indent=19 \
155 -v indent=19 \
140 -v col_on="$$(tput setaf 6)" \
156 -v col_on="$$(tput setaf 6)" \
141 -v col_off="$$(tput sgr0)" \
157 -v col_off="$$(tput sgr0)" \
142 '{ \
158 '{ \
143 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
159 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
144 n = split($$2, words, " "); \
160 n = split($$2, words, " "); \
145 line_length = ncol - indent; \
161 line_length = ncol - indent; \
146 for (i = 1; i <= n; i++) { \
162 for (i = 1; i <= n; i++) { \
147 line_length -= length(words[i]) + 1; \
163 line_length -= length(words[i]) + 1; \
148 if (line_length <= 0) { \
164 if (line_length <= 0) { \
149 line_length = ncol - indent - length(words[i]) - 1; \
165 line_length = ncol - indent - length(words[i]) - 1; \
150 printf "\n%*s ", -indent, " "; \
166 printf "\n%*s ", -indent, " "; \
151 } \
167 } \
152 printf "%s ", words[i]; \
168 printf "%s ", words[i]; \
153 } \
169 } \
154 printf "\n"; \
170 printf "\n"; \
155 }'
171 }'
156
General Comments 0
You need to be logged in to leave comments. Login now