Makefile
98 lines
| 2.8 KiB
| text/x-makefile
|
MakefileLexer
r4617 | .DEFAULT_GOAL := help | |||
r1220 | ||||
r4617 | # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py | |||
OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES} | ||||
r1 | ||||
NODE_PATH=./node_modules | ||||
r3162 | WEBPACK=./node_binaries/webpack | |||
GRUNT=./node_binaries/grunt | ||||
r1220 | ||||
r4617 | .PHONY: clean | |||
clean: ## full clean | ||||
r1220 | make test-clean | |||
r3476 | find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';' | |||
r1 | ||||
r4617 | ||||
.PHONY: test | ||||
test: ## run test-clean and tests | ||||
r1220 | make test-clean | |||
make test-only | ||||
r13 | ||||
r4617 | ||||
.PHONY:test-clean | ||||
test-clean: ## run test-clean and tests | ||||
r1220 | rm -rf coverage.xml htmlcov junit.xml pylint.log result | |||
find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';' | ||||
r3845 | find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';' | |||
r1220 | ||||
r4617 | ||||
.PHONY: test-only | ||||
test-only: ## run tests | ||||
r2100 | PYTHONHASHSEED=random \ | |||
r4617 | py.test -x -vv -r xw -p no:sugar \ | |||
--cov=rhodecode --cov-report=term-missing --cov-report=html \ | ||||
r2100 | rhodecode | |||
r4617 | ||||
.PHONY: test-only-mysql | ||||
test-only-mysql: ## run tests against mysql | ||||
r2100 | PYTHONHASHSEED=random \ | |||
r4617 | py.test -x -vv -r xw -p no:sugar \ | |||
--cov=rhodecode --cov-report=term-missing --cov-report=html \ | ||||
r3976 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test?charset=utf8"}}' \ | |||
r2100 | rhodecode | |||
r4617 | ||||
.PHONY: test-only-postgres | ||||
test-only-postgres: ## run tests against postgres | ||||
r2100 | PYTHONHASHSEED=random \ | |||
r4617 | py.test -x -vv -r xw -p no:sugar \ | |||
--cov=rhodecode --cov-report=term-missing --cov-report=html \ | ||||
r2100 | --ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \ | |||
rhodecode | ||||
r4617 | .PHONY: docs | |||
docs: ## build docs | ||||
r13 | (cd docs; nix-build default.nix -o result; make clean html) | |||
r1 | ||||
r4617 | ||||
.PHONY: docs-clean | ||||
docs-clean: ## Cleanup docs | ||||
r13 | (cd docs; make clean) | |||
r4617 | ||||
.PHONY: docs-cleanup | ||||
docs-cleanup: ## Cleanup docs | ||||
r1214 | (cd docs; make cleanup) | |||
r4617 | ||||
.PHONY: web-build | ||||
web-build: ## Build static/js | ||||
r1 | NODE_PATH=$(NODE_PATH) $(GRUNT) | |||
r4617 | ||||
.PHONY: generate-pkgs | ||||
generate-pkgs: ## generate new python packages | ||||
r3450 | nix-shell pkgs/shell-generate.nix --command "pip2nix generate --licenses" | |||
r3531 | ||||
r4617 | ||||
.PHONY: pip-packages | ||||
pip-packages: ## show outdated packages | ||||
r4253 | python ${OUTDATED_PACKAGES} | |||
r4617 | ||||
.PHONY: generate-js-pkgs | ||||
generate-js-pkgs: ## generate js packages | ||||
r3531 | rm -rf node_modules && \ | |||
nix-shell pkgs/shell-generate.nix --command "node2nix --input package.json -o pkgs/node-packages.nix -e pkgs/node-env.nix -c pkgs/node-default.nix -d --flatten --nodejs-8" && \ | ||||
sed -i -e 's/http:\/\//https:\/\//g' pkgs/node-packages.nix | ||||
r4617 | ||||
.PHONY: generate-license-meta | ||||
generate-license-meta: ## Generate license metadata | ||||
r3531 | nix-build pkgs/license-generate.nix -o result-license && \ | |||
r4617 | cat result-license/licenses.json | python -m json.tool > rhodecode/config/licenses.json | |||
.PHONY: help | ||||
help: | ||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}' | ||||