-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
36 lines (25 loc) · 1.01 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
IMAGE ?= rstudio/r-system-requirements
VARIANTS ?= focal jammy noble buster bullseye bookworm sid centos7 centos8 rockylinux9 opensuse155 opensuse156 fedora39 fedora40 fedora41 alpine-3.17 alpine-3.18 alpine-3.19 alpine-3.20 alpine-edge
RULES ?= rules/*.json
all: build-all
define GEN_BUILD_IMAGES
build-$(variant):
docker build --platform=linux/amd64 -t $(IMAGE):$(variant) docker/$(variant)/.
test-$(variant):
for rule in $(RULES); do \
docker run --rm --platform=linux/amd64 -v $(PWD):/work -e DIST=$(variant) -e RULES=/work/$$$${rule} $(IMAGE):$(variant) /work/test/test-packages.sh || exit 1; \
done
bash-$(variant):
docker run -it --rm -v $(PWD):/work -e DIST=$(variant) -e RULES=/work/$(RULES) $(IMAGE):$(variant) /bin/bash
BUILD_IMAGES += build-$(variant)
TEST_IMAGES += test-$(variant)
endef
$(foreach variant,$(VARIANTS), \
$(eval $(GEN_BUILD_IMAGES)) \
)
build-all: $(BUILD_IMAGES)
test-all: $(TEST_IMAGES)
update-sysreqs:
cd test && Rscript get-sysreqs.R > sysreqs.json
print-variants:
@echo $(VARIANTS)