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