-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
51 lines (41 loc) · 1.14 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CONTAINER_ENGINE ?= $(shell which podman >/dev/null 2>&1 && echo podman || echo docker)
.PHONY: format
format:
uv run ruff check
uv run ruff format
build-test-image:
$(CONTAINER_ENGINE) build -t agd-test .
.PHONY: pr-check
pr-check: build-test-image
$(CONTAINER_ENGINE) run --rm agd-test make test
.PHONY: test
test:
uv run ruff check --no-fix
uv run ruff format --check
uv run pytest -vv
uv run mypy
.PHONY: ci-run
ci-run: build-test-image
# Allow docker to write to output directory
chmod a+w output/*
# Run agd rds-eol
$(CONTAINER_ENGINE) run --rm \
-v '$(PWD)/output':/output:z \
-e AGD_RDS_EOL_ENGINES='$(AGD_RDS_EOL_ENGINES)' \
-e AGD_RDS_EOL_OUTPUT='/output/$(AGD_RDS_EOL_OUTPUT)' \
-e AGD_MSK_RELEASE_CALENDAR_URL='$(AGD_MSK_RELEASE_CALENDAR_URL)' \
-e AGD_MSK_EOL_OUTPUT='/output/$(AGD_MSK_EOL_OUTPUT)' \
agd-test make run
# Commit changes if any
@status=$$(git status --porcelain --untracked-files=no); \
if [ ! -z "$${status}" ]; \
then \
git add output/*; \
git commit -m "Update data"; \
fi
.PHONY: run
run: run-rds-eol run-msk-eol
run-rds-eol:
uv run agd rds-eol fetch
run-msk-eol:
uv run agd msk-eol fetch