forked from bersler/OpenLogReplicator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.54 KB
/
Makefile
File metadata and controls
47 lines (38 loc) · 1.54 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
40
41
42
43
44
45
46
47
OLR_IMAGE ?= olr-dev:latest
CACHE_IMAGE ?= ghcr.io/bersler/openlogreplicator:ci
BUILD_TYPE ?= Debug
FIXTURE_ARCHIVES := $(wildcard tests/fixtures/*.tar.gz)
FIXTURE_DIRS := $(FIXTURE_ARCHIVES:.tar.gz=)
.PHONY: help build test-redo extract-fixtures fixtures clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
build: ## Build OLR Docker image
docker buildx build \
--build-arg BUILD_TYPE=$(BUILD_TYPE) \
--build-arg UIDOLR=$$(id -u) \
--build-arg GIDOLR=$$(id -g) \
--build-arg GIDORA=54322 \
--build-arg WITHORACLE=1 \
--build-arg WITHKAFKA=1 \
--build-arg WITHPROTOBUF=1 \
--build-arg WITHPROMETHEUS=1 \
--cache-from type=registry,ref=$(CACHE_IMAGE) \
-t $(OLR_IMAGE) \
--load \
-f Dockerfile.dev .
tests/fixtures/%: tests/fixtures/%.tar.gz
rm -rf $@
tar xzf $< -C tests/fixtures/
touch $@
extract-fixtures: $(FIXTURE_DIRS) ## Extract fixture archives
test-redo: extract-fixtures ## Run redo log regression tests (no Oracle needed)
cd tests && OLR_IMAGE=$(OLR_IMAGE) pytest fixtures/test_fixtures.py -v --tb=short $(PYTEST_ARGS)
fixtures: ## Archive generated fixtures as tar.gz for committing
@for dir in tests/sql/generated/*/; do \
[ -d "$$dir" ] || continue; \
name=$$(basename "$$dir"); \
echo "Archiving $$name..."; \
tar czf "tests/fixtures/$$name.tar.gz" -C tests/sql/generated "$$name/"; \
done
clean: ## Remove generated fixtures and working directories
rm -rf tests/sql/generated tests/.work $(FIXTURE_DIRS)