##// END OF EJS Templates
makefiles: synced makefiles
super-admin -
r5419:887a9753 default
parent child Browse files
Show More
@@ -1,196 +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 .PHONY: clean
9 9 ## Cleanup compiled and cache py files
10 10 clean:
11 11 make test-clean
12 12 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
13 13 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
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
40 .PHONY: test-only-mysql
41 ## run tests against mysql
42 test-only-mysql:
43 PYTHONHASHSEED=random \
44 py.test -x -vv -r xw -p no:sugar \
45 --cov-report=term-missing --cov-report=html \
46 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \
47 --cov=rhodecode rhodecode
48
49
50 .PHONY: test-only-postgres
51 ## run tests against postgres
52 test-only-postgres:
53 PYTHONHASHSEED=random \
54 py.test -x -vv -r xw -p no:sugar \
55 --cov-report=term-missing --cov-report=html \
56 --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
57 --cov=rhodecode rhodecode
58
59 .PHONY: ruff-check
60 ## run a ruff analysis
61 ruff-check:
62 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
63
64
65 40 .PHONY: docs
66 41 ## build docs
67 42 docs:
68 43 (cd docs; docker run --rm -v $(PWD):/project --workdir=/project/docs sphinx-doc-build-rc make clean html)
69 44
70 45
71 46 .PHONY: docs-clean
72 47 ## Cleanup docs
73 48 docs-clean:
74 49 (cd docs; docker run --rm -v $(PWD):/project --workdir=/project/docs sphinx-doc-build-rc make clean)
75 50
76 51
77 52 .PHONY: docs-cleanup
78 53 ## Cleanup docs
79 54 docs-cleanup:
80 55 (cd docs; docker run --rm -v $(PWD):/project --workdir=/project/docs sphinx-doc-build-rc make cleanup)
81 56
82 57
83 58 .PHONY: web-build
84 59 ## Build JS packages static/js
85 60 web-build:
86 61 docker run -it --rm -v $(PWD):/project --workdir=/project rhodecode/static-files-build:16 -c "npm install && /project/node_modules/.bin/grunt"
87 62 # run static file check
88 63 ./rhodecode/tests/scripts/static-file-check.sh rhodecode/public/
89 64 rm -rf node_modules
90 65
91 66 .PHONY: ruff-check
92 67 ## run a ruff analysis
93 68 ruff-check:
94 69 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
95 70
96 71 .PHONY: pip-packages
97 72 ## Show outdated packages
98 73 pip-packages:
99 74 python ${OUTDATED_PACKAGES}
100 75
101 76
102 77 .PHONY: build
103 78 ## Build sdist/egg
104 79 build:
105 80 python -m build
106 81
107 82
108 83 .PHONY: dev-sh
109 84 ## make dev-sh
110 85 dev-sh:
111 86 sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list"
112 87 sudo apt-get update
113 88 sudo apt-get install -y zsh carapace-bin
114 89 rm -rf /home/rhodecode/.oh-my-zsh
115 90 curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
116 91 @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc
117 92 @echo "${RC_DEV_CMD_HELP}"
118 93 @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
119 94
120 95
121 96 .PHONY: dev-cleanup
122 97 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
123 98 dev-cleanup:
124 99 pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
125 100 rm -rf /tmp/*
126 101
127 102
128 103 .PHONY: dev-env
129 104 ## make dev-env based on the requirements files and install develop of packages
130 105 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
131 106 dev-env:
132 107 sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/
133 108 pip install build virtualenv
134 109 pushd ../rhodecode-vcsserver/ && make dev-env && popd
135 110 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
136 111 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
137 112 pip install -e .
138 113
139 114
140 115 .PHONY: sh
141 116 ## shortcut for make dev-sh dev-env
142 117 sh:
143 118 make dev-env
144 119 make dev-sh
145 120
146 121
147 122 ## Allows changes of workers e.g make dev-srv-g workers=2
148 123 workers?=1
149 124
150 125 .PHONY: dev-srv
151 126 ## run gunicorn web server with reloader, use workers=N to set multiworker mode
152 127 dev-srv:
153 128 gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10020 --config=.dev/gunicorn_config.py --timeout=120 --reload --workers=$(workers)
154 129
155 130
156 131 # Default command on calling make
157 132 .DEFAULT_GOAL := show-help
158 133
159 134 .PHONY: show-help
160 135 show-help:
161 136 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
162 137 @echo
163 138 @sed -n -e "/^## / { \
164 139 h; \
165 140 s/.*//; \
166 141 :doc" \
167 142 -e "H; \
168 143 n; \
169 144 s/^## //; \
170 145 t doc" \
171 146 -e "s/:.*//; \
172 147 G; \
173 148 s/\\n## /---/; \
174 149 s/\\n/ /g; \
175 150 p; \
176 151 }" ${MAKEFILE_LIST} \
177 152 | LC_ALL='C' sort --ignore-case \
178 153 | awk -F '---' \
179 154 -v ncol=$$(tput cols) \
180 155 -v indent=19 \
181 156 -v col_on="$$(tput setaf 6)" \
182 157 -v col_off="$$(tput sgr0)" \
183 158 '{ \
184 159 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
185 160 n = split($$2, words, " "); \
186 161 line_length = ncol - indent; \
187 162 for (i = 1; i <= n; i++) { \
188 163 line_length -= length(words[i]) + 1; \
189 164 if (line_length <= 0) { \
190 165 line_length = ncol - indent - length(words[i]) - 1; \
191 166 printf "\n%*s ", -indent, " "; \
192 167 } \
193 168 printf "%s ", words[i]; \
194 169 } \
195 170 printf "\n"; \
196 171 }'
General Comments 0
You need to be logged in to leave comments. Login now