-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
60 lines (48 loc) · 1.44 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
52
53
54
55
56
57
58
59
60
BLUBBER_VARIANTS := buster bullseye bookworm
# deployment.eqiad.wmnet currently runs bullseye
DEFAULT_VARIANT := bullseye
VERIFY_DEPS_IMAGE = local/scap-$(*F)-verify-deps
TEST_IMAGE = local/scap-$(*F)-test
.PHONY: default
default:
$(info This Makefile does not have a default target.)
$(info Targets:)
$(info `make test` Run tests for $(DEFAULT_VARIANT))
$(info `make test-all` Run tests for $(BLUBBER_VARIANTS))
$(info `make reformat` Reformat source code using 'black' formatter)
$(error exiting...)
########################
# RULES
########################
test-image-%:
rm -fr ./tests/scap/__pycache__
@# Note: This copies all of the current directory into the container image
DOCKER_BUILDKIT=1 docker build \
-f .pipeline/blubber.yaml \
--target verify-deps-$(*F) \
-t $(VERIFY_DEPS_IMAGE) .
DOCKER_BUILDKIT=1 docker build \
-f .pipeline/blubber.yaml \
--target test-$(*F) \
-t $(TEST_IMAGE) .
test-%: test-image-%
docker run -it --rm $(TEST_IMAGE)
binary-dist-image-%:
DOCKER_BUILDKIT=1 docker build \
-f .pipeline/blubber.yaml \
--target binary-dist-$* \
-t local/scap-dist-$* .
########################
# TARGETS
########################
.PHONY: test-images
images: $(BLUBBER_VARIANTS:%=test-image-%)
.PHONY: test-all
test-all: $(BLUBBER_VARIANTS:%=test-%)
.PHONY: test
test: test-$(DEFAULT_VARIANT)
.PHONY: dist-images
dist-images: $(BLUBBER_VARIANTS:%=binary-dist-image-%)
.PHONY: reformat
reformat:
tox -e reformat