Show More
@@ -1,72 +1,134 b'' | |||
|
1 | 1 | |
|
2 | .PHONY: clean docs docs-clean docs-cleanup test test-clean test-only test-only-postgres test-only-mysql web-build generate-pkgs pip-packages build-nix | |
|
2 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py | |
|
3 | OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} | |
|
3 | 4 | |
|
4 | 5 | NODE_PATH=./node_modules |
|
5 | 6 | WEBPACK=./node_binaries/webpack |
|
6 | 7 | GRUNT=./node_binaries/grunt |
|
7 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py | |
|
8 | OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} | |
|
9 | 8 | |
|
9 | .PHONY: clean | |
|
10 | ## Cleanup compiled and cache py files | |
|
10 | 11 | clean: |
|
11 | 12 | make test-clean |
|
12 | 13 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' |
|
13 | 14 | |
|
15 | ||
|
16 | .PHONY: test | |
|
17 | ## run test-clean and tests | |
|
14 | 18 | test: |
|
15 | 19 | make test-clean |
|
16 | 20 | make test-only |
|
17 | 21 | |
|
22 | ||
|
23 | .PHONY:test-clean | |
|
24 | ## run test-clean and tests | |
|
18 | 25 | test-clean: |
|
19 | 26 | rm -rf coverage.xml htmlcov junit.xml pylint.log result |
|
20 | 27 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' |
|
21 | 28 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' |
|
22 | 29 | |
|
30 | ||
|
31 | .PHONY: test-only | |
|
32 | ## Run tests only without cleanup | |
|
23 | 33 | test-only: |
|
24 | 34 | PYTHONHASHSEED=random \ |
|
25 |
py.test -x -vv -r xw -p no:sugar |
|
|
26 |
|
|
|
27 | rhodecode | |
|
35 | py.test -x -vv -r xw -p no:sugar \ | |
|
36 | --cov-report=term-missing --cov-report=html \ | |
|
37 | --cov=rhodecode rhodecode | |
|
28 | 38 | |
|
39 | .PHONY: test-only-mysql | |
|
40 | ## run tests against mysql | |
|
29 | 41 | test-only-mysql: |
|
30 | 42 | PYTHONHASHSEED=random \ |
|
31 |
py.test -x -vv -r xw -p no:sugar |
|
|
32 |
|
|
|
43 | py.test -x -vv -r xw -p no:sugar \ | |
|
44 | --cov-report=term-missing --cov-report=html \ | |
|
33 | 45 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \ |
|
34 | rhodecode | |
|
46 | --cov=rhodecode rhodecode | |
|
47 | ||
|
35 | 48 | |
|
49 | .PHONY: test-only-postgres | |
|
50 | ## run tests against postgres | |
|
36 | 51 | test-only-postgres: |
|
37 | 52 | PYTHONHASHSEED=random \ |
|
38 |
py.test -x -vv -r xw -p no:sugar |
|
|
39 |
|
|
|
53 | py.test -x -vv -r xw -p no:sugar \ | |
|
54 | --cov-report=term-missing --cov-report=html \ | |
|
40 | 55 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \ |
|
41 | rhodecode | |
|
56 | --cov=rhodecode rhodecode | |
|
42 | 57 | |
|
43 | ||
|
58 | .PHONY: docs | |
|
59 | ## build docs | |
|
44 | 60 | docs: |
|
45 | 61 | (cd docs; nix-build default.nix -o result; make clean html) |
|
46 | 62 | |
|
63 | ||
|
64 | .PHONY: docs-clean | |
|
65 | ## Cleanup docs | |
|
47 | 66 | docs-clean: |
|
48 | 67 | (cd docs; make clean) |
|
49 | 68 | |
|
69 | ||
|
70 | .PHONY: docs-cleanup | |
|
71 | ## Cleanup docs | |
|
50 | 72 | docs-cleanup: |
|
51 | 73 | (cd docs; make cleanup) |
|
52 | 74 | |
|
75 | ||
|
76 | .PHONY: web-build | |
|
77 | ## Build JS packages static/js | |
|
53 | 78 | web-build: |
|
54 | 79 | NODE_PATH=$(NODE_PATH) $(GRUNT) |
|
55 | 80 | |
|
56 | generate-pkgs: | |
|
57 | nix-shell pkgs/shell-generate.nix --command "pip2nix generate --licenses --no-binary :all:" | |
|
58 | 81 | |
|
82 | .PHONY: pip-packages | |
|
83 | ## show outdated packages | |
|
59 | 84 | pip-packages: |
|
60 | 85 | python ${OUTDATED_PACKAGES} |
|
61 | 86 | |
|
62 | generate-js-pkgs: | |
|
63 | rm -rf node_modules && \ | |
|
64 | nix-shell pkgs/shell-generate.nix --command "node2nix --input package.json -o pkgs/node-packages.nix -e pkgs/node-env.nix -c pkgs/node-default.nix -d --flatten --nodejs-12" && \ | |
|
65 | sed -i -e 's/http:\/\//https:\/\//g' pkgs/node-packages.nix | |
|
87 | ||
|
88 | .PHONY: sdist | |
|
89 | ## Build sdist | |
|
90 | sdist: | |
|
91 | python setup.py sdist | |
|
92 | ||
|
93 | ||
|
94 | # Default command on calling make | |
|
95 | .DEFAULT_GOAL := show-help | |
|
66 | 96 | |
|
67 | generate-license-meta: | |
|
68 | nix-build pkgs/license-generate.nix -o result-license && \ | |
|
69 | cat result-license/licenses.json | python -m json.tool > rhodecode/config/licenses.json | |
|
70 | ||
|
71 | build-nix: | |
|
72 | nix-build --show-trace --option sandbox false --option max-jobs 4 --option cores 4 | |
|
97 | .PHONY: show-help | |
|
98 | show-help: | |
|
99 | @echo "$$(tput bold)Available rules:$$(tput sgr0)" | |
|
100 | @echo | |
|
101 | @sed -n -e "/^## / { \ | |
|
102 | h; \ | |
|
103 | s/.*//; \ | |
|
104 | :doc" \ | |
|
105 | -e "H; \ | |
|
106 | n; \ | |
|
107 | s/^## //; \ | |
|
108 | t doc" \ | |
|
109 | -e "s/:.*//; \ | |
|
110 | G; \ | |
|
111 | s/\\n## /---/; \ | |
|
112 | s/\\n/ /g; \ | |
|
113 | p; \ | |
|
114 | }" ${MAKEFILE_LIST} \ | |
|
115 | | LC_ALL='C' sort --ignore-case \ | |
|
116 | | awk -F '---' \ | |
|
117 | -v ncol=$$(tput cols) \ | |
|
118 | -v indent=19 \ | |
|
119 | -v col_on="$$(tput setaf 6)" \ | |
|
120 | -v col_off="$$(tput sgr0)" \ | |
|
121 | '{ \ | |
|
122 | printf "%s%*s%s ", col_on, -indent, $$1, col_off; \ | |
|
123 | n = split($$2, words, " "); \ | |
|
124 | line_length = ncol - indent; \ | |
|
125 | for (i = 1; i <= n; i++) { \ | |
|
126 | line_length -= length(words[i]) + 1; \ | |
|
127 | if (line_length <= 0) { \ | |
|
128 | line_length = ncol - indent - length(words[i]) - 1; \ | |
|
129 | printf "\n%*s ", -indent, " "; \ | |
|
130 | } \ | |
|
131 | printf "%s ", words[i]; \ | |
|
132 | } \ | |
|
133 | printf "\n"; \ | |
|
134 | }' |
General Comments 0
You need to be logged in to leave comments.
Login now