generated from app-sre/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
29 lines (24 loc) · 808 Bytes
/
Makefile
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
CONTAINER_ENGINE ?= $(shell which podman >/dev/null 2>&1 && echo podman || echo docker)
IMAGE_NAME ?= gitlab-project-exporter
IMAGE_TAG ?= $(shell git rev-parse --short=7 HEAD)
format:
uv run ruff check
uv run ruff format
.PHONY: format
test:
uv lock --locked
uv run ruff check --no-fix
uv run ruff format --check
uv run mypy
uv run pytest -vv --cov=gitlab_project_exporter --cov-report=term-missing --cov-report xml
.PHONY: test
build:
$(CONTAINER_ENGINE) build -t $(IMAGE_NAME):$(IMAGE_TAG) --target prod .
$(CONTAINER_ENGINE) tag $(IMAGE_NAME):$(IMAGE_TAG) $(IMAGE_NAME):latest
.PHONY: build
container-test:
$(CONTAINER_ENGINE) build --target test -t $(IMAGE_NAME):test-$(IMAGE_TAG) $(foreach arg,$(BUILD_ARGS),--build-arg $(arg)) .
.PHONY: container-test
.PHONY: dev-env
dev-env:
uv sync