2020-06-29 23:21:42 -06:00
|
|
|
#################
|
|
|
|
|
### detection-rules
|
|
|
|
|
#################
|
|
|
|
|
|
|
|
|
|
VENV := ./env/detection-rules-build
|
|
|
|
|
VENV_BIN := $(VENV)/bin
|
|
|
|
|
PYTHON := $(VENV_BIN)/python
|
2024-03-14 19:48:50 -05:00
|
|
|
PIP := $(VENV_BIN)/python -m pip
|
2020-06-29 23:21:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: release
|
|
|
|
|
|
2024-03-14 19:48:50 -05:00
|
|
|
|
2020-06-29 23:21:42 -06:00
|
|
|
$(VENV):
|
2024-03-14 19:48:50 -05:00
|
|
|
pip3 install virtualenv
|
|
|
|
|
virtualenv $(VENV) --python=python3.8
|
|
|
|
|
$(PIP) install .[dev]
|
|
|
|
|
$(PIP) install setuptools -U
|
|
|
|
|
|
2020-06-29 23:21:42 -06:00
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
2024-03-14 19:48:50 -05:00
|
|
|
rm -rf $(VENV) *.egg-info .eggs .egg htmlcov build dist packages .build .tmp .tox __pycache__
|
2020-06-29 23:21:42 -06:00
|
|
|
|
|
|
|
|
.PHONY: deps
|
2024-03-14 19:48:50 -05:00
|
|
|
deps: $(VENV)
|
2022-12-08 15:49:49 -05:00
|
|
|
$(PIP) install .[dev]
|
2020-06-29 23:21:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: pytest
|
|
|
|
|
pytest: $(VENV) deps
|
|
|
|
|
$(PYTHON) -m detection_rules test
|
|
|
|
|
|
|
|
|
|
.PHONY: license-check
|
|
|
|
|
license-check: $(VENV) deps
|
|
|
|
|
@echo "LICENSE CHECK"
|
2020-10-07 22:15:33 +02:00
|
|
|
$(PYTHON) -m detection_rules dev license-check
|
2020-06-29 23:21:42 -06:00
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
|
lint: $(VENV) deps
|
|
|
|
|
@echo "LINTING"
|
|
|
|
|
$(PYTHON) -m flake8 tests detection_rules --ignore D203 --max-line-length 120
|
|
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
|
test: $(VENV) lint pytest
|
|
|
|
|
|
|
|
|
|
.PHONY: release
|
|
|
|
|
release: deps
|
|
|
|
|
@echo "RELEASE: $(app_name)"
|
2022-03-04 09:55:11 -09:00
|
|
|
$(PYTHON) -m detection_rules dev build-release --generate-navigator
|
2020-06-29 23:21:42 -06:00
|
|
|
rm -rf dist
|
|
|
|
|
mkdir dist
|
|
|
|
|
cp -r releases/*/*.zip dist/
|
2020-07-08 18:02:12 -06:00
|
|
|
|
|
|
|
|
.PHONY: kibana-commit
|
|
|
|
|
kibana-commit: deps
|
|
|
|
|
@echo "PREP KIBANA-COMMIT: $(app_name)"
|
2020-10-07 22:15:33 +02:00
|
|
|
$(PYTHON) -m detection_rules dev kibana-commit
|