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