-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (33 loc) · 1.42 KB
/
Makefile
File metadata and controls
39 lines (33 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
APP_IMAGE ?= hub.adsw.io/adcm/adcm
APP_TAG ?= $(subst /,_,$(BRANCH_NAME))
SELENOID_HOST ?= 10.92.2.65
SELENOID_PORT ?= 4444
ADCM_VERSION = "2.12.0-dev"
PY_FILES = python dev/linters conf/adcm/python_scripts
.PHONY: build unittests pretty lint version
build:
@docker build --platform=linux/amd64 . -t $(APP_IMAGE):$(APP_TAG) --build-arg ADCM_VERSION=$(ADCM_VERSION)
unittests:
time docker run -d --rm -e POSTGRES_PASSWORD="postgres" --name postgres -p 5500:5432 postgres:14
time poetry install --no-root --with unittests
DJANGO_SETTINGS_MODULE=adcm.settings.test \
DB_HOST="localhost" DB_USER="postgres" DB_PORT="5500" DB_NAME="postgres" DB_PASS="postgres" \
time poetry run python/manage.py test python -v 2 --parallel --keepdb
docker stop postgres
pretty:
poetry install --no-root --with lint
poetry run ruff format $(PY_FILES)
poetry run ruff check --fix $(PY_FILES)
poetry run ruff format $(PY_FILES)
poetry run python dev/linters/license_checker.py --fix --folders $(PY_FILES) go
lint:
poetry install --no-root --with lint
poetry run ruff check $(PY_FILES)
poetry run ruff format --check $(PY_FILES)
poetry run pyright --project pyproject.toml
env PYTHONPATH=python poetry run lint-imports --verbose
poetry run python dev/linters/license_checker.py --folders $(PY_FILES) go
poetry run python dev/linters/migrations_checker.py python
version:
@echo $(ADCM_VERSION)