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 | NODE_PATH=./node_modules |
|
5 | NODE_PATH=./node_modules | |
5 | WEBPACK=./node_binaries/webpack |
|
6 | WEBPACK=./node_binaries/webpack | |
6 | GRUNT=./node_binaries/grunt |
|
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 | clean: |
|
11 | clean: | |
11 | make test-clean |
|
12 | make test-clean | |
12 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' |
|
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 | test: |
|
18 | test: | |
15 | make test-clean |
|
19 | make test-clean | |
16 | make test-only |
|
20 | make test-only | |
17 |
|
21 | |||
|
22 | ||||
|
23 | .PHONY:test-clean | |||
|
24 | ## run test-clean and tests | |||
18 | test-clean: |
|
25 | test-clean: | |
19 | rm -rf coverage.xml htmlcov junit.xml pylint.log result |
|
26 | rm -rf coverage.xml htmlcov junit.xml pylint.log result | |
20 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' |
|
27 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' | |
21 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' |
|
28 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' | |
22 |
|
29 | |||
|
30 | ||||
|
31 | .PHONY: test-only | |||
|
32 | ## Run tests only without cleanup | |||
23 | test-only: |
|
33 | test-only: | |
24 | PYTHONHASHSEED=random \ |
|
34 | PYTHONHASHSEED=random \ | |
25 |
py.test -x -vv -r xw -p no:sugar |
|
35 | py.test -x -vv -r xw -p no:sugar \ | |
26 |
|
|
36 | --cov-report=term-missing --cov-report=html \ | |
27 | rhodecode |
|
37 | --cov=rhodecode rhodecode | |
28 |
|
38 | |||
|
39 | .PHONY: test-only-mysql | |||
|
40 | ## run tests against mysql | |||
29 | test-only-mysql: |
|
41 | test-only-mysql: | |
30 | PYTHONHASHSEED=random \ |
|
42 | PYTHONHASHSEED=random \ | |
31 |
py.test -x -vv -r xw -p no:sugar |
|
43 | py.test -x -vv -r xw -p no:sugar \ | |
32 |
|
|
44 | --cov-report=term-missing --cov-report=html \ | |
33 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \ |
|
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 | test-only-postgres: |
|
51 | test-only-postgres: | |
37 | PYTHONHASHSEED=random \ |
|
52 | PYTHONHASHSEED=random \ | |
38 |
py.test -x -vv -r xw -p no:sugar |
|
53 | py.test -x -vv -r xw -p no:sugar \ | |
39 |
|
|
54 | --cov-report=term-missing --cov-report=html \ | |
40 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \ |
|
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 | docs: |
|
60 | docs: | |
45 | (cd docs; nix-build default.nix -o result; make clean html) |
|
61 | (cd docs; nix-build default.nix -o result; make clean html) | |
46 |
|
62 | |||
|
63 | ||||
|
64 | .PHONY: docs-clean | |||
|
65 | ## Cleanup docs | |||
47 | docs-clean: |
|
66 | docs-clean: | |
48 | (cd docs; make clean) |
|
67 | (cd docs; make clean) | |
49 |
|
68 | |||
|
69 | ||||
|
70 | .PHONY: docs-cleanup | |||
|
71 | ## Cleanup docs | |||
50 | docs-cleanup: |
|
72 | docs-cleanup: | |
51 | (cd docs; make cleanup) |
|
73 | (cd docs; make cleanup) | |
52 |
|
74 | |||
|
75 | ||||
|
76 | .PHONY: web-build | |||
|
77 | ## Build JS packages static/js | |||
53 | web-build: |
|
78 | web-build: | |
54 | NODE_PATH=$(NODE_PATH) $(GRUNT) |
|
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 | pip-packages: |
|
84 | pip-packages: | |
60 | python ${OUTDATED_PACKAGES} |
|
85 | python ${OUTDATED_PACKAGES} | |
61 |
|
86 | |||
62 | generate-js-pkgs: |
|
87 | ||
63 | rm -rf node_modules && \ |
|
88 | .PHONY: sdist | |
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" && \ |
|
89 | ## Build sdist | |
65 | sed -i -e 's/http:\/\//https:\/\//g' pkgs/node-packages.nix |
|
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: |
|
97 | .PHONY: show-help | |
68 | nix-build pkgs/license-generate.nix -o result-license && \ |
|
98 | show-help: | |
69 | cat result-license/licenses.json | python -m json.tool > rhodecode/config/licenses.json |
|
99 | @echo "$$(tput bold)Available rules:$$(tput sgr0)" | |
70 |
|
100 | @echo | ||
71 | build-nix: |
|
101 | @sed -n -e "/^## / { \ | |
72 | nix-build --show-trace --option sandbox false --option max-jobs 4 --option cores 4 |
|
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