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