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