Show More
@@ -1,138 +1,137 b'' | |||||
1 | # required for pushd to work.. |
|
1 | # required for pushd to work.. | |
2 | SHELL = /bin/bash |
|
2 | SHELL = /bin/bash | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py |
|
5 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py | |
6 | OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} |
|
6 | OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} | |
7 |
|
7 | |||
8 | .PHONY: clean |
|
8 | .PHONY: clean | |
9 | ## Cleanup compiled and cache py files |
|
9 | ## Cleanup compiled and cache py files | |
10 | clean: |
|
10 | clean: | |
11 | make test-clean |
|
11 | make test-clean | |
12 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' |
|
12 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' | |
13 | find . -type d -name "build" -prune -exec rm -rf '{}' ';' |
|
13 | find . -type d -name "build" -prune -exec rm -rf '{}' ';' | |
14 |
|
14 | |||
15 |
|
15 | |||
16 | .PHONY: test |
|
16 | .PHONY: test | |
17 | ## run test-clean and tests |
|
17 | ## run test-clean and tests | |
18 | test: |
|
18 | test: | |
19 | make test-clean |
|
19 | make test-clean | |
20 | make test-only |
|
20 | make test-only | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | .PHONY: test-clean |
|
23 | .PHONY: test-clean | |
24 | ## run test-clean and tests |
|
24 | ## run test-clean and tests | |
25 | test-clean: |
|
25 | test-clean: | |
26 | rm -rf coverage.xml htmlcov junit.xml pylint.log result |
|
26 | rm -rf coverage.xml htmlcov junit.xml pylint.log result | |
27 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' |
|
27 | find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' | |
28 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' |
|
28 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | .PHONY: test-only |
|
31 | .PHONY: test-only | |
32 | ## Run tests only without cleanup |
|
32 | ## Run tests only without cleanup | |
33 | test-only: |
|
33 | test-only: | |
34 | PYTHONHASHSEED=random \ |
|
34 | PYTHONHASHSEED=random \ | |
35 | py.test -x -vv -r xw -p no:sugar \ |
|
35 | py.test -x -vv -r xw -p no:sugar \ | |
36 | --cov-report=term-missing --cov-report=html \ |
|
36 | --cov-report=term-missing --cov-report=html \ | |
37 | --cov=vcsserver vcsserver |
|
37 | --cov=vcsserver vcsserver | |
38 |
|
38 | |||
39 |
|
39 | |||
40 | .PHONY: ruff-check |
|
40 | .PHONY: ruff-check | |
41 | ## run a ruff analysis |
|
41 | ## run a ruff analysis | |
42 | ruff-check: |
|
42 | ruff-check: | |
43 | ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev . |
|
43 | ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev . | |
44 |
|
44 | |||
45 |
|
||||
46 | .PHONY: pip-packages |
|
45 | .PHONY: pip-packages | |
47 | ## Show outdated packages |
|
46 | ## Show outdated packages | |
48 | pip-packages: |
|
47 | pip-packages: | |
49 | python ${OUTDATED_PACKAGES} |
|
48 | python ${OUTDATED_PACKAGES} | |
50 |
|
49 | |||
51 |
|
50 | |||
52 | .PHONY: build |
|
51 | .PHONY: build | |
53 | ## Build sdist/egg |
|
52 | ## Build sdist/egg | |
54 | build: |
|
53 | build: | |
55 | python -m build |
|
54 | python -m build | |
56 |
|
55 | |||
57 |
|
56 | |||
58 | .PHONY: dev-sh |
|
57 | .PHONY: dev-sh | |
59 | ## make dev-sh |
|
58 | ## make dev-sh | |
60 | dev-sh: |
|
59 | dev-sh: | |
61 | sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list" |
|
60 | sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list" | |
62 | sudo apt-get update |
|
61 | sudo apt-get update | |
63 | sudo apt-get install -y zsh carapace-bin |
|
62 | sudo apt-get install -y zsh carapace-bin | |
64 | rm -rf /home/rhodecode/.oh-my-zsh |
|
63 | rm -rf /home/rhodecode/.oh-my-zsh | |
65 | curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh |
|
64 | curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
66 | @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc |
|
65 | @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc | |
67 | @echo "${RC_DEV_CMD_HELP}" |
|
66 | @echo "${RC_DEV_CMD_HELP}" | |
68 | @PROMPT='%(?.%F{green}β.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh |
|
67 | @PROMPT='%(?.%F{green}β.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh | |
69 |
|
68 | |||
70 |
|
69 | |||
71 | .PHONY: dev-env |
|
70 | .PHONY: dev-env | |
72 | ## make dev-env based on the requirements files and install develop of packages |
|
71 | ## make dev-env based on the requirements files and install develop of packages | |
73 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y |
|
72 | ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y | |
74 | dev-env: |
|
73 | dev-env: | |
75 | sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/ |
|
74 | sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/ | |
76 | pip install build virtualenv |
|
75 | pip install build virtualenv | |
77 | pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
76 | pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt | |
78 | pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt |
|
77 | pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt | |
79 | pip install -e . |
|
78 | pip install -e . | |
80 |
|
79 | |||
81 |
|
80 | |||
82 | .PHONY: sh |
|
81 | .PHONY: sh | |
83 | ## shortcut for make dev-sh dev-env |
|
82 | ## shortcut for make dev-sh dev-env | |
84 | sh: |
|
83 | sh: | |
85 | make dev-env |
|
84 | make dev-env | |
86 | make dev-sh |
|
85 | make dev-sh | |
87 |
|
86 | |||
88 |
|
87 | |||
89 | ## Allows changes of workers e.g make dev-srv-g workers=2 |
|
88 | ## Allows changes of workers e.g make dev-srv-g workers=2 | |
90 | workers?=1 |
|
89 | workers?=1 | |
91 |
|
90 | |||
92 | .PHONY: dev-srv |
|
91 | .PHONY: dev-srv | |
93 | ## run gunicorn multi process workers |
|
92 | ## run gunicorn web server with reloader, use workers=N to set multiworker mode | |
94 |
dev-srv |
|
93 | dev-srv: | |
95 | gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers) |
|
94 | gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers) | |
96 |
|
95 | |||
97 |
|
96 | |||
98 | # Default command on calling make |
|
97 | # Default command on calling make | |
99 | .DEFAULT_GOAL := show-help |
|
98 | .DEFAULT_GOAL := show-help | |
100 |
|
99 | |||
101 | .PHONY: show-help |
|
100 | .PHONY: show-help | |
102 | show-help: |
|
101 | show-help: | |
103 | @echo "$$(tput bold)Available rules:$$(tput sgr0)" |
|
102 | @echo "$$(tput bold)Available rules:$$(tput sgr0)" | |
104 | @echo |
|
103 | @echo | |
105 | @sed -n -e "/^## / { \ |
|
104 | @sed -n -e "/^## / { \ | |
106 | h; \ |
|
105 | h; \ | |
107 | s/.*//; \ |
|
106 | s/.*//; \ | |
108 | :doc" \ |
|
107 | :doc" \ | |
109 | -e "H; \ |
|
108 | -e "H; \ | |
110 | n; \ |
|
109 | n; \ | |
111 | s/^## //; \ |
|
110 | s/^## //; \ | |
112 | t doc" \ |
|
111 | t doc" \ | |
113 | -e "s/:.*//; \ |
|
112 | -e "s/:.*//; \ | |
114 | G; \ |
|
113 | G; \ | |
115 | s/\\n## /---/; \ |
|
114 | s/\\n## /---/; \ | |
116 | s/\\n/ /g; \ |
|
115 | s/\\n/ /g; \ | |
117 | p; \ |
|
116 | p; \ | |
118 | }" ${MAKEFILE_LIST} \ |
|
117 | }" ${MAKEFILE_LIST} \ | |
119 | | LC_ALL='C' sort --ignore-case \ |
|
118 | | LC_ALL='C' sort --ignore-case \ | |
120 | | awk -F '---' \ |
|
119 | | awk -F '---' \ | |
121 | -v ncol=$$(tput cols) \ |
|
120 | -v ncol=$$(tput cols) \ | |
122 | -v indent=19 \ |
|
121 | -v indent=19 \ | |
123 | -v col_on="$$(tput setaf 6)" \ |
|
122 | -v col_on="$$(tput setaf 6)" \ | |
124 | -v col_off="$$(tput sgr0)" \ |
|
123 | -v col_off="$$(tput sgr0)" \ | |
125 | '{ \ |
|
124 | '{ \ | |
126 | printf "%s%*s%s ", col_on, -indent, $$1, col_off; \ |
|
125 | printf "%s%*s%s ", col_on, -indent, $$1, col_off; \ | |
127 | n = split($$2, words, " "); \ |
|
126 | n = split($$2, words, " "); \ | |
128 | line_length = ncol - indent; \ |
|
127 | line_length = ncol - indent; \ | |
129 | for (i = 1; i <= n; i++) { \ |
|
128 | for (i = 1; i <= n; i++) { \ | |
130 | line_length -= length(words[i]) + 1; \ |
|
129 | line_length -= length(words[i]) + 1; \ | |
131 | if (line_length <= 0) { \ |
|
130 | if (line_length <= 0) { \ | |
132 | line_length = ncol - indent - length(words[i]) - 1; \ |
|
131 | line_length = ncol - indent - length(words[i]) - 1; \ | |
133 | printf "\n%*s ", -indent, " "; \ |
|
132 | printf "\n%*s ", -indent, " "; \ | |
134 | } \ |
|
133 | } \ | |
135 | printf "%s ", words[i]; \ |
|
134 | printf "%s ", words[i]; \ | |
136 | } \ |
|
135 | } \ | |
137 | printf "\n"; \ |
|
136 | printf "\n"; \ | |
138 | }' |
|
137 | }' |
General Comments 0
You need to be logged in to leave comments.
Login now