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