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