-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (40 loc) · 1.96 KB
/
Makefile
File metadata and controls
50 lines (40 loc) · 1.96 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
48
49
50
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) Red Hat, Inc. 2026
#
# Author: Michal Rábek <mrabek@redhat.com>
DISTROS := debian fedora tumbleweed alpine
DOCKERFILES := $(addprefix main/Dockerfile.,$(DISTROS))
STAGING_DOCKERFILES := $(addprefix staging/Dockerfile.,$(DISTROS))
BUILD_TARGETS := $(addprefix build-,$(DISTROS))
STAGING_BUILD_TARGETS := $(addprefix build-staging-,$(DISTROS))
.PHONY: all help generate build staging-dockerfiles $(BUILD_TARGETS) $(STAGING_BUILD_TARGETS)
all: generate build staging-build
help:
@echo "Available targets:"
@echo " all - Generate and build all containers (default)"
@echo " generate - Generate all Dockerfiles"
@echo " staging-dockerfiles - Generate staging Dockerfiles"
@echo " build - Build normal containers"
@echo " staging-build - Build staging containers"
@echo " Dockerfile.<distro> - Generate Dockerfile for <distro>"
@echo " build-<distro> - Build normal container for <distro>"
@echo " build-staging-<distro> - Build staging container for <distro>"
# Generation targets
generate: $(DOCKERFILES) $(STAGING_DOCKERFILES)
staging-dockerfiles: $(STAGING_DOCKERFILES)
main/Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
@if [ "$*" = "debian" ]; then \
./generate.py --distro $* --bundles nvme,muon-dep,musl,coverage,coverity,docs,python --features muon --output $@; \
else \
./generate.py --distro $* --bundles nvme,muon-dep,python --features muon --output $@; \
fi
staging/Dockerfile.%: ci-containers.yaml generate.py templates/Dockerfile.%.j2
./generate.py --distro $* --bundles muon --output $@
# Build targets
build: $(BUILD_TARGETS)
staging-build: $(STAGING_BUILD_TARGETS)
$(BUILD_TARGETS): build-%: | main/Dockerfile.%
sudo docker build -f main/Dockerfile.$* -t ci:$* .
$(STAGING_BUILD_TARGETS): build-staging-%: | staging/Dockerfile.%
sudo docker build -f staging/Dockerfile.$* -t ci:$*-staging .