forked from confidential-containers/cloud-api-adaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.defaults
52 lines (44 loc) · 2.72 KB
/
Makefile.defaults
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
YQ_COMMAND ?= yq
VERSIONS_SRC := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/versions.yaml
ifeq (, $(shell command -v $(YQ_COMMAND) 2> /dev/null))
$(error "$(YQ_COMMAND) not found, consider doing snap install yq")
endif
# As we need `yq` to be installed to fetch the values from versions.yaml
# these values are hardcoded here, all other versions/references should be
# stored in versions.yaml
YQ_VERSION := v4.35.1
YQ_CHECKSUM := "sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
MINIMUM_YQ_MAJOR_VERSION := 4
INSTALLED_YQ_MAJOR_VERSION := $(shell $(YQ_COMMAND) --version | sed -nE 's/.* v?([0-9]+).*/\1/p')
ifneq ($(MINIMUM_YQ_MAJOR_VERSION), $(INSTALLED_YQ_MAJOR_VERSION))
$(error "yq major version should be $(MINIMUM_YQ_MAJOR_VERSION), is: $(INSTALLED_YQ_MAJOR_VERSION)")
endif
VERSIONS_HASH := $(firstword $(shell sha256sum $(VERSIONS_SRC)))
define query
$(or $(shell $(YQ_COMMAND) '.$(1) | select(. != null)' $(VERSIONS_SRC)), \
$(error $(1) is not set, and could not be automatically set from $(VERSIONS_SRC)))
endef
ubuntu_RELEASE ?= focal
centos_RELEASE ?= stream-9
rhel_RELEASE ?= 9
ubuntu_amd64_IMAGE_URL := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).amd64.url)
ubuntu_amd64_IMAGE_CHECKSUM := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).amd64.checksum)
ubuntu_s390x_IMAGE_URL := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).s390x.url)
ubuntu_s390x_IMAGE_CHECKSUM := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).s390x.checksum)
centos_amd64_IMAGE_URL := $(call query,cloudimg.centos.$(centos_RELEASE).amd64.url)
centos_amd64_IMAGE_CHECKSUM := $(call query,cloudimg.centos.$(centos_RELEASE).amd64.checksum)
rhel_amd64_IMAGE_URL := $(call query,cloudimg.rhel.$(rhel_RELEASE).amd64.url)
rhel_amd64_IMAGE_CHECKSUM := $(call query,cloudimg.rhel.$(rhel_RELEASE).amd64.checksum)
KATA_SRC := $(or $(KATA_SRC),$(call query,git.kata-containers.url))
KATA_SRC_REF := $(or $(KATA_SRC_REF),$(call query,git.kata-containers.reference))
GO_VERSION := $(or $(GO_VERSION),$(call query,tools.golang))
PROTOC_VERSION := $(or $(PROTOC_VERSION),$(call query,tools.protoc))
RUST_VERSION := $(or $(RUST_VERSION),$(call query,tools.rust))
SKOPEO_REPO := $(or $(SKOPEO_REPO),$(call query,git.skopeo.url))
SKOPEO_VERSION := $(or $(SKOPEO_VERSION),$(call query,git.skopeo.reference))
UMOCI_REPO := $(or $(UMOCI_REPO),$(call query,git.umoci.url))
UMOCI_VERSION := $(or $(UMOCI_VERSION),$(call query,git.umoci.reference))
GUEST_COMPONENTS_REPO := $(or $(GUEST_COMPONENTS_REPO),$(call query,git.guest-components.url))
GUEST_COMPONENTS_VERSION := $(or $(GUEST_COMPONENTS_VERSION),$(call query,git.guest-components.reference))
PAUSE_REPO := $(or $(PAUSE_REPO),$(call query,oci.pause.registry))
PAUSE_VERSION := $(or $(PAUSE_VERSION),$(call query,oci.pause.tag))