-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 2.54 KB
/
Copy pathMakefile
File metadata and controls
74 lines (60 loc) · 2.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
usage:
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " usage Show this help message"
@echo " lint Run pre-commit linters on all files"
@echo " build Build multi-arch image locally (no push)"
@echo " build-amd64 Build image for linux/amd64, load into local Docker"
@echo " build-arm64 Build image for linux/arm64, load into local Docker"
@echo " build-release Build multi-arch image and push to registry"
@echo " verify Build then verify Ruby + jemalloc (local tag)"
@echo " verify-amd64 Build then verify amd64 image"
@echo " verify-arm64 Build then verify arm64 image"
@echo " verify-release Build-release then verify both architectures"
@echo " push Push latest tag to registry"
@echo " push-arm64 Push arm64 image to registry"
@echo " pull-arm64 Pull arm64 image from registry"
@echo " clean Remove local build cache and images"
@echo ""
@echo "Variables (override with make VAR=value):"
@echo " REGISTRY $(REGISTRY)"
@echo " MULTIARCH_TAG $(MULTIARCH_TAG)"
@echo " MULTIARCH_PLATFORMS $(MULTIARCH_PLATFORMS)"
@echo " MULTIARCH_CACHE_DIR $(MULTIARCH_CACHE_DIR)"
@echo ""
REGISTRY ?= ghcr.io/umnlibraries/ruby2.6-jemalloc
MULTIARCH_TAG ?= sha-$(shell git rev-parse --short HEAD 2>/dev/null || echo local)
MULTIARCH_PLATFORMS ?= linux/amd64,linux/arm64
MULTIARCH_CACHE_DIR ?= .buildx-cache
clean:
-rm -rf .buildx-cache .buildx-cache-new
-docker rmi --force ruby2.6-jemalloc:local
lint:
pre-commit run --all-file
build:
docker build --progress=plain --platform "$(MULTIARCH_PLATFORMS)" --tag $(REGISTRY):latest .
.PHONY: tags
tags:
docker tag $(REGISTRY):latest $(REGISTRY):0.0.5
push:
docker push $(REGISTRY):latest
docker push $(REGISTRY):0.0.5
build-amd64:
docker buildx build --platform linux/amd64 --load -t ruby2.6-jemalloc:amd64 .
build-arm64:
docker buildx build --platform linux/arm64 --load -t ruby2.6-jemalloc:arm64 .
push-arm64:
docker push --platform linux/arm64 $(REGISTRY):latest
pull-arm64:
docker pull --platform linux/arm64 $(REGISTRY):latest
verify: build
./scripts/verify-ruby-jemalloc.sh ruby2.6-jemalloc:latest
verify-amd64: build-amd64
./scripts/verify-ruby-jemalloc.sh ruby2.6-jemalloc:amd64 linux/amd64
verify-arm64: build-arm64
./scripts/verify-ruby-jemalloc.sh ruby2.6-jemalloc:arm64 linux/arm64
verify-release: build-release
./scripts/verify-ruby-jemalloc.sh $(REGISTRY):$(MULTIARCH_TAG) linux/amd64
./scripts/verify-ruby-jemalloc.sh $(REGISTRY):$(MULTIARCH_TAG) linux/arm64