-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.79 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.79 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
51
52
53
PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-12 debian-13 centos-7 centos-8 rhel-9 rhel-10 opensuse-156 opensuse-160 fedora-41 fedora-42 fedora-43
docker-build:
@cd builder && docker compose build --parallel
docker-down:
@cd builder && docker compose down
docker-build-r: docker-build
@cd builder && docker compose up
docker-shell-r-env:
@cd builder && docker compose run --entrypoint /bin/bash ubuntu-2004
define GEN_TARGETS
# Use PLATFORM_ARCH to override the architecture, e.g. PLATFORM_ARCH=linux/arm64 or PLATFORM_ARCH=linux/amd64
# If unset, PLATFORM_ARCH will default to the architecture of the host machine.
docker-build-$(platform):
@cd builder && PLATFORM_ARCH=$(PLATFORM_ARCH) docker compose build $(platform)
build-r-$(platform):
cd builder && R_VERSION=$(R_VERSION) PLATFORM_ARCH=$(PLATFORM_ARCH) docker compose run --rm $(platform)
test-r-$(platform):
@cd test && R_VERSION=$(R_VERSION) PLATFORM_ARCH=$(PLATFORM_ARCH) docker compose run --rm $(platform)
publish-r-$(platform):
aws s3 cp builder/integration/tmp/r/$(platform)/ s3://$(S3_BUCKET)/r/$(platform) --recursive
aws s3 cp builder/integration/tmp/$(platform)/ s3://$(S3_BUCKET)/r/$(platform)/pkgs --recursive
bash-$(platform):
docker run -it --rm --entrypoint /bin/bash -v $(CURDIR):/r-builds r-builds:$(platform)
.PHONY: docker-build-$(platform) build-r-$(platform) test-r-$(platform) publish-r-$(platform) bash-$(platform)
endef
$(foreach platform,$(PLATFORMS), \
$(eval $(GEN_TARGETS)) \
)
print-platforms:
@echo $(PLATFORMS)
# Helper for launching a bash session on a docker image of your choice. Defaults
# to "ubuntu:noble".
TARGET_IMAGE?=ubuntu:noble
bash:
docker run --privileged=true -it --rm \
-v $(CURDIR):/r-builds \
-w /r-builds \
${TARGET_IMAGE} /bin/bash
.PHONY: docker-build docker-down print-platforms