-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
174 lines (122 loc) · 7.84 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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
VERSION=$(shell bin/garden-version)
IMAGE_BASENAME=garden-linux
PUBLIC=true
AWS_DISTRIBUTE=
BUILDDIR=.build
ARCH ?= $(shell ./get_arch.sh)
override BUILD_OPTS += --arch=$(ARCH)
ifneq ($(wildcard local_packages),)
LOCAL_PKGS=local_packages
endif
ifdef LOCAL_PKGS
$(info using local packages from $(LOCAL_PKGS))
override BUILD_OPTS += --local-pkgs=$(LOCAL_PKGS)
endif
GARDENLINUX_BUILD_CRE ?= sudo podman
.PHONY:all
all: all_dev all_prod
SECUREBOOT_CRT=cert/secureboot.db.sign.crt
$(SECUREBOOT_CRT): | container-build
$(GARDENLINUX_BUILD_CRE) run --rm --volume '$(realpath $(dir $@)):/cert' 'gardenlinux/build-cert:$(VERSION)' make --directory=/cert default
.PHONY: container-build
container-build:
make --directory=container build-image build-cert
container-test:
make --directory=container build-base-test
container-integration:
make --directory=container build-integration-test
build-environment: container-test container-build
all_prod: ali aws gcp azure metal openstack vmware kvm
all_dev: ali-dev aws-dev gcp-dev azure-dev metal-dev openstack-dev vmware-dev kvm-dev
ALI_IMAGE_NAME=$(IMAGE_BASENAME)-ali-$(VERSION)
ali: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,ali $(BUILDDIR) $(VERSION)
ali-upload:
aliyun oss cp $(BUILDDIR)/ali-gardener-amd64-$(VERSION)-local/rootfs.qcow2 oss://gardenlinux-development/gardenlinux/$(ALI_IMAGE_NAME).qcow2
ALI_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-dev-ali-$(VERSION)
ali-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,ali,_dev $(BUILDDIR) $(VERSION)
ali-dev-upload:
aliyun oss cp $(BUILDDIR)/ali-gardener_dev-amd64-$(VERSION)-local/rootfs.qcow2 oss://gardenlinux-development/gardenlinux/$(ALI_DEV_IMAGE_NAME).qcow2
AWS_IMAGE_NAME=$(IMAGE_BASENAME)-aws-$(VERSION)
aws: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,aws $(BUILDDIR) $(VERSION)
aws-upload:
./bin/make-ec2-ami --bucket gardenlinux-testing --region eu-north-1 --image-name=$(AWS_IMAGE_NAME) $(BUILDDIR)/aws-gardener-amd64-$(VERSION)-local/rootfs.raw --permission-public "$(PUBLIC)" --distribute "$(AWS_DISTRIBUTE)"
AWS_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-dev-aws-$(VERSION)
aws-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,aws,_dev $(BUILDDIR) ${VERSION}
aws-dev-upload:
./bin/make-ec2-ami --bucket ami-debian-image-test --region eu-north-1 --image-name=$(AWS_DEV_IMAGE_NAME) $(BUILDDIR)/aws-gardener_dev-amd64-$(VERSION)-local/rootfs.raw --permission-public "$(PUBLIC)" --distribute "$(AWS_DISTRIBUTE)"
GCP_IMAGE_NAME=$(IMAGE_BASENAME)-gcp-$(VERSION)
gcp: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,gcp $(BUILDDIR) $(VERSION)
gcp-upload:
./bin/make-gcp-ami --bucket garden-linux-test --image-name $(GCP_IMAGE_NAME) --raw-image-path $(BUILDDIR)/gcp-gardener-amd64-$(VERSION)-local/rootfs-gcpimage.tar.gz --permission-public "$(PUBLIC)"
GCP_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-dev-gcp-$(VERSION)
gcp-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,gcp,_dev $(BUILDDIR) $(VERSION)
gcp-dev-upload:
./bin/make-gcp-ami --bucket garden-linux-test --image-name $(GCP_DEV_IMAGE_NAME) --raw-image-path $(BUILDDIR)/gcp-gardener_dev-amd64-$(VERSION)-local/rootfs-gcpimage.tar.gz --permission-public "$(PUBLIC)"
AZURE_IMAGE_NAME=$(IMAGE_BASENAME)-az-$(VERSION)
azure: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,azure $(BUILDDIR) $(VERSION)
azure-upload:
./bin/make-azure-ami --resource-group garden-linux --storage-account-name gardenlinux --image-path=$(BUILDDIR)/azure-gardener-amd64-$(VERSION)-local/rootfs.vhd --image-name=$(AZURE_IMAGE_NAME)
AZURE_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-dev-az-$(VERSION)
azure-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,azure,_dev $(BUILDDIR) $(VERSION)
azure-dev-upload:
./bin/make-azure-ami --resource-group garden-linux --storage-account-name gardenlinuxdev --image-path=$(BUILDDIR)/azure-gardener_dev-amd64-$(VERSION)-local/rootfs.vhd --image-name=$(AZURE_DEV_IMAGE_NAME)
OPENSTACK_IMAGE_NAME=$(IMAGE_BASENAME)-openstack-$(VERSION)
openstack: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,openstack $(BUILDDIR) $(VERSION)
openstack-upload:
./bin/upload-openstack $(BUILDDIR)/openstack-gardener-amd64-$(VERSION)-local/rootfs.vmdk $(OPENSTACK_IMAGE_NAME)
OPENSTACK_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-openstack-dev-$(VERSION)
openstack-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,openstack,_dev $(BUILDDIR) $(VERSION)
openstack-dev-upload:
./bin/upload-openstack $(BUILDDIR)/openstack-gardener_dev-amd64-$(VERSION)-local/rootfs.vmdk $(OPENSTACK_DEV_IMAGE_NAME)
openstack-qcow2: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --features server,cloud,gardener,openstack-qcow2 $(BUILDDIR) $(VERSION)
VMWARE_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-vmware-dev-$(VERSION)
vmware-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,vmware,_dev $(BUILDDIR) $(VERSION)
VMWARE_VMOPERATOR_DEV_IMAGE_NAME=$(IMAGE_BASENAME)-vmware-vmoperator-dev-$(VERSION)
vmware-vmoperator-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,vmware-vmoperator,_dev $(BUILDDIR)/vmware-vmoperator-dev $(VERSION)
vmware: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,gardener,vmware $(BUILDDIR) $(VERSION)
cloud: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud $(BUILDDIR) $(VERSION)
kvm: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,kvm $(BUILDDIR) $(VERSION)
kvm-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud,kvm,_dev $(BUILDDIR) $(VERSION)
pxe: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features metal,server,_pxe $(BUILDDIR) $(VERSION)
pxe-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features metal,server,_dev,_pxe $(BUILDDIR) $(VERSION)
metal-iso: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features metal,server,_iso $(BUILDDIR) $(VERSION)
anvil: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,cloud-anvil,kvm,_dev $(BUILDDIR) $(VERSION)
onmetal: metal
metal: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,metal $(BUILDDIR) $(VERSION)
metal-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features server,metal,_dev $(BUILDDIR) $(VERSION)
metalk: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features metal,khost,_pxe $(BUILDDIR) $(VERSION)
metalk-dev: build-environment $(SECUREBOOT_CRT)
./build.sh $(BUILD_OPTS) --skip-build --features metal,khost,_pxe,_dev $(BUILDDIR) $(VERSION)
clean:
@echo "emptying $(BUILDDIR)"
@rm -rf $(BUILDDIR)/*
@echo "deleting all containers running gardenlinux/build-image"
@-$(GARDENLINUX_BUILD_CRE) container rm $$($(GARDENLINUX_BUILD_CRE) container ls -a | awk '{ print $$1,$$2 }' | grep gardenlinux/build-image: | awk '{ print $$1 }') 2> /dev/null || true
@echo "deleting all containers running gardenlinux/integration-test"
@-$(GARDENLINUX_BUILD_CRE) container rm $$($(GARDENLINUX_BUILD_CRE) container ls -a | awk '{ print $$1,$$2 }' | grep gardenlinux/integration-test: | awk '{ print $$1 }') 2> /dev/null || true
distclean: clean
make --directory=container clean