##// END OF EJS Templates
dev(makefile): updated dev env to be synced with CE edition
super-admin -
r1174:67a44c16 default
parent child Browse files
Show More
@@ -1,128 +1,130 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
45
46 .PHONY: pip-packages
46 .PHONY: pip-packages
47 ## Show outdated packages
47 ## Show outdated packages
48 pip-packages:
48 pip-packages:
49 python ${OUTDATED_PACKAGES}
49 python ${OUTDATED_PACKAGES}
50
50
51
51
52 .PHONY: build
52 .PHONY: build
53 ## Build sdist/egg
53 ## Build sdist/egg
54 build:
54 build:
55 python -m build
55 python -m build
56
56
57
57
58 .PHONY: dev-sh
58 .PHONY: dev-sh
59 ## make dev-sh
59 ## make dev-sh
60 dev-sh:
60 dev-sh:
61 sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list"
61 sudo apt-get update
62 sudo apt-get update
62 sudo apt-get install -y zsh
63 sudo apt-get install -y zsh carapace-bin
63 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
65 echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc
64 PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
66 PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
65
67
66 .PHONY: dev-env
68 .PHONY: dev-env
67 ## make dev-env based on the requirements files and install develop of packages
69 ## make dev-env based on the requirements files and install develop of packages
68 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
70 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
69 dev-env:
71 dev-env:
70 pip install build virtualenv
72 pip install build virtualenv
71 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
73 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
72 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
74 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
73 pip install -e .
75 pip install -e .
74
76
75
77
76 .PHONY: dev-srv
78 .PHONY: dev-srv
77 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
79 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
78 dev-srv:
80 dev-srv:
79 pserve --reload .dev/dev.ini
81 pserve --reload .dev/dev.ini
80
82
81
83
82 .PHONY: dev-srv-g
84 .PHONY: dev-srv-g
83 ## run gunicorn multi process workers
85 ## run gunicorn multi process workers
84 dev-srv-g:
86 dev-srv-g:
85 gunicorn --workers=4 --paste .dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py
87 gunicorn --workers=4 --paste .dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py
86
88
87
89
88 # Default command on calling make
90 # Default command on calling make
89 .DEFAULT_GOAL := show-help
91 .DEFAULT_GOAL := show-help
90
92
91 .PHONY: show-help
93 .PHONY: show-help
92 show-help:
94 show-help:
93 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
95 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
94 @echo
96 @echo
95 @sed -n -e "/^## / { \
97 @sed -n -e "/^## / { \
96 h; \
98 h; \
97 s/.*//; \
99 s/.*//; \
98 :doc" \
100 :doc" \
99 -e "H; \
101 -e "H; \
100 n; \
102 n; \
101 s/^## //; \
103 s/^## //; \
102 t doc" \
104 t doc" \
103 -e "s/:.*//; \
105 -e "s/:.*//; \
104 G; \
106 G; \
105 s/\\n## /---/; \
107 s/\\n## /---/; \
106 s/\\n/ /g; \
108 s/\\n/ /g; \
107 p; \
109 p; \
108 }" ${MAKEFILE_LIST} \
110 }" ${MAKEFILE_LIST} \
109 | LC_ALL='C' sort --ignore-case \
111 | LC_ALL='C' sort --ignore-case \
110 | awk -F '---' \
112 | awk -F '---' \
111 -v ncol=$$(tput cols) \
113 -v ncol=$$(tput cols) \
112 -v indent=19 \
114 -v indent=19 \
113 -v col_on="$$(tput setaf 6)" \
115 -v col_on="$$(tput setaf 6)" \
114 -v col_off="$$(tput sgr0)" \
116 -v col_off="$$(tput sgr0)" \
115 '{ \
117 '{ \
116 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
118 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
117 n = split($$2, words, " "); \
119 n = split($$2, words, " "); \
118 line_length = ncol - indent; \
120 line_length = ncol - indent; \
119 for (i = 1; i <= n; i++) { \
121 for (i = 1; i <= n; i++) { \
120 line_length -= length(words[i]) + 1; \
122 line_length -= length(words[i]) + 1; \
121 if (line_length <= 0) { \
123 if (line_length <= 0) { \
122 line_length = ncol - indent - length(words[i]) - 1; \
124 line_length = ncol - indent - length(words[i]) - 1; \
123 printf "\n%*s ", -indent, " "; \
125 printf "\n%*s ", -indent, " "; \
124 } \
126 } \
125 printf "%s ", words[i]; \
127 printf "%s ", words[i]; \
126 } \
128 } \
127 printf "\n"; \
129 printf "\n"; \
128 }'
130 }'
General Comments 0
You need to be logged in to leave comments. Login now